A new extension has just landed in Babylon.js: Navmesh and agents navigation.
You can now populate your scene with autonomous agents with path finding and avoidance.
The documentation is accessible here Babylon.js Documentation under the tag ‘navigation’
The feature is still in beta so feel free to test and post your requests and issues in the forum.
Nice project.
I’m trying to make it work. I downloaded the demo to try it on my pc but i get this error: ReferenceError: Recast is not defined
But the demo works on babylonjs playground. I’m using the exactly same demo code.
Basically, the parameters you provided are not valid with your mesh so a navmesh can be computed. The error message is not explicit and will be improve in the future.
For height maps, maybe try to tweak the climb height. If it’s too steep with a small climb height value then no walkable area will be found.
Do you have a PG so I can help you debug the parameters?
Pretty good. How did you manage to get the filesize to be decently enough within 755KB?
Is there any way to save the dtNavMesh so it can be reloaded again? What about Dynamic obstacles? Also, tileSize seems to do nothing? Is it possible to create tiled navmeshes?
Also, is it possible to have a build with only Detour but no Recast?
All those features are available with recast but we only expose a small portions. Depending on the need and use cases of Babylon.js users we will add the corresponding api calls and documentation.
At a basic level though, it’s needs the requestAgentVelocity function to directly input velocity into agent instead of set target location. That one shouldn’t add anything to the file size.