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?
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:
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
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.