# Trouble understanding navmesh parameters

**URL:** <https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770>\
**Category:** Questions\
**Tags:** navmesh\
**Created:** [December 28, 2023, 2:40am UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770 "2023-12-28T02:40:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/thomas/32/29205_2.png) [@thomas](https://forum.babylonjs.com/u/thomas)\
**Post date:** [December 28, 2023, 2:40am UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770/1 "2023-12-28T02:40:42Z")

</div>

Here is what my scene and navmesh look like:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/9/59b560f5ad96204e95380bc44ec9d0718f13c457.jpeg)

and here are my parameters:

```auto
const parameters = {
    cs: 0.2,
    ch: 0.1,
    walkableSlopeAngle: 0,
    walkableHeight: 0,
    walkableClimb: 0,
    walkableRadius: 0.5,
    maxEdgeLen: 12,
    maxSimplificationError: 1.3,
    minRegionArea: 1,
    mergeRegionArea: 1,
    maxVertsPerPoly: 6,
    detailSampleDist: 6,
    detailSampleMaxError: 1,
  };

```

Basically, I’m trying to make it so that agents can’t walk through the tables. I assume the red areas are valid walkable areas, and the clear areas are blocked off.

I don’t understand:

- Why there is a clear section connecting one of the table legs to the statue
- Why all the table legs are not blocked off
- How I could make the ground below the surface of the table blocked off

Thanks!

---

<div class="post-metadata">

**Author:** ![musk](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/musk/32/17156_2.png) [@musk](https://forum.babylonjs.com/u/musk)\
**Post date:** [December 28, 2023, 3:36am UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770/2 "2023-12-28T03:36:51Z")

</div>

I usually create appropriately sized boxes at the location of obstacles such as tables, merge them with the ground mesh, and then create a navigation mesh.

---

<div class="post-metadata">

**Author:** ![thomas](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/thomas/32/29205_2.png) [@thomas](https://forum.babylonjs.com/u/thomas)\
**Post date:** [December 28, 2023, 4:22am UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770/3 "2023-12-28T04:22:26Z")

</div>

Unfortunately I don’t think I can go this route in this case, but will keep that in mind, thank you!

---

<div class="post-metadata">

**Author:** ![thomas](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/thomas/32/29205_2.png) [@thomas](https://forum.babylonjs.com/u/thomas)\
**Post date:** [December 28, 2023, 6:19am UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770/4 "2023-12-28T06:19:24Z")

</div>

Ok I’ve figured out “why all the table legs are not blocked off”: reducing the maxSimplificationError to 0.1 blocks them all off, so they are just too small.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/d/0dbd03cf892230e6a84bc977b7ea4907e61ed3a8.jpeg)

Now I just need to figure out 1) if there’s a way to block off the area below the table and 2) why there’s a line connecting one of the tables to the statue.

EDIT: Figured out the answer to #1, I need to set a walkableHeight \> height of table.

---

<div class="post-metadata">

**Author:** ![thomas](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/thomas/32/29205_2.png) [@thomas](https://forum.babylonjs.com/u/thomas)\
**Post date:** [December 28, 2023, 6:40am UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770/5 "2023-12-28T06:40:49Z")

</div>

Not totally sure which adjustment got rid of the line between a table and the statue, but these parameters seem to give me the result I was wanting:

```auto
const parameters = {
    cs: 0.5,
    ch: 0.5,
    walkableSlopeAngle: 0,
    walkableHeight: 4,
    walkableClimb: 0,
    walkableRadius: 0.5,
    maxEdgeLen: 12,
    maxSimplificationError: 0.5,
    minRegionArea: 3,
    mergeRegionArea: 5,
    maxVertsPerPoly: 6,
    detailSampleDist: 6,
    detailSampleMaxError: 1,
  };

```

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/d/6deef97bae00c1f52ebceeb737d706720c4b8c28.jpeg)

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [December 29, 2023, 11:04am UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770/6 "2023-12-29T11:04:16Z")

</div>

Hi!  
I’m glad you solved the issue. Here is a tip to see how various parameters affects the navmesh. You can create a debug navmesh which is the calculated mesh actually used to navigate (not your source navmesh). I used to put it slighlty above my source navmesh and make it transparent.

```auto
    const navmeshdebug = navigationPlugin.createDebugNavMesh(this.scene)
    navmeshdebug.position = new Vector3(0, 0.1, 0)
    const matdebug = new StandardMaterial('navdebug', this.scene)
    matdebug.emissiveColor = new Color3(0, 0, 1)
    matdebug.diffuseColor = new Color3(0, 0, 1)
    matdebug.alpha = 0.6
    navmeshdebug.material = matdebug

```

🖖

---

<div class="post-metadata">

**Author:** ![thomas](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/thomas/32/29205_2.png) [@thomas](https://forum.babylonjs.com/u/thomas)\
**Post date:** [December 29, 2023, 5:09pm UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770/7 "2023-12-29T17:09:57Z")

</div>

Thank you, yes, that’s what the red is in the photos

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [December 29, 2023, 6:04pm UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770/8 "2023-12-29T18:04:00Z")

</div>

See also: [Digesting Duck: Recast Settings Uncovered](http://digestingduck.blogspot.com/2009/08/recast-settings-uncovered.html)

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [December 29, 2023, 8:26pm UTC](https://forum.babylonjs.com/t/trouble-understanding-navmesh-parameters/46770/9 "2023-12-29T20:26:24Z")

</div>

Very cool! Thanks!
