# Navmesh generated but not visible (debug on)

**URL:** <https://forum.babylonjs.com/t/navmesh-generated-but-not-visible-debug-on/17474>\
**Category:** Questions\
**Created:** [January 14, 2021, 11:25am UTC](https://forum.babylonjs.com/t/navmesh-generated-but-not-visible-debug-on/17474 "2021-01-14T11:25:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Censor](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@Censor](https://forum.babylonjs.com/u/Censor)\
**Post date:** [January 14, 2021, 11:25am UTC](https://forum.babylonjs.com/t/navmesh-generated-but-not-visible-debug-on/17474/1 "2021-01-14T11:25:20Z")

</div>

Me again 🙂 I’ve been trying a lot of stuff in BabylonJS and liking it a lot!  
Now I’m trying to get a navmesh to show up so I can tweak it with terrain generated from a heightmap.  
I messed around with the parameters to get recast to actually give me ‘done’ in the console, based on information from older topics.  
I added code to show the navmesh, but nothing shows up. Can anyone help me getting the navmesh to be visible so it can be tweaked? Or am I messing something up?

Playground:  
[https://playground.babylonjs.com/#FUN65H#1](https://playground.babylonjs.com/#FUN65H#1)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [January 14, 2021, 11:34am UTC](https://forum.babylonjs.com/t/navmesh-generated-but-not-visible-debug-on/17474/2 "2021-01-14T11:34:40Z")

</div>

Hi @Censor ,

The first reason it doesn’t work is that ground mesh creation is async. so the ground mesh is not yet ready when you create the navmesh. Initializing the navmesh in the onReady would solve the first issue:

[Navmesh not visible | Babylon.js Playground](https://playground.babylonjs.com/#FUN65H#2)

I will let @Cedric comment regarding the navmesh itself

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [January 14, 2021, 1:03pm UTC](https://forum.babylonjs.com/t/navmesh-generated-but-not-visible-debug-on/17474/3 "2021-01-14T13:03:00Z")

</div>

Yes, @RaananW is right. the creation is async and you have to create the navmesh once it’s ready like in this PG:  
[groundtexture + navmesh | Babylon.js Playground](https://playground.babylonjs.com/#RNAHTL)  
Also, take care of the values. a `cs` or `ch` that is too small compared to your terrain size will prevent the nav mesh creation because it would need too much memory.

---

<div class="post-metadata">

**Author:** ![Censor](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@Censor](https://forum.babylonjs.com/u/Censor)\
**Post date:** [January 14, 2021, 1:17pm UTC](https://forum.babylonjs.com/t/navmesh-generated-but-not-visible-debug-on/17474/4 "2021-01-14T13:17:35Z")

</div>

Thank you both for replying, I got it working now!  
Made function async as RaananW said, and changed cs and ch values to make it show up without error.
