I’ve been working on using RecastJS for navigation for a few days. Everything is fine except the agent mesh is always travelling in straight line even if there is obstacle.
In the image below, the red cover is visualized debug mesh generated by
createDebugNavMesh(), you can see there is a non-walkable area showing under the obstacle building. The white line is generated using points provided by
RecastJSPlugin.computePath(), which is correct.
However, once the agent mesh start to travel using
agentGoto() function, it never follows the white path but goes straight to destination, as shown with black line I drew manually.
The thing that worked for me is when one agent mesh is about to collide with another agent mesh, they know to avoid each other.
Any thoughts about where should I look into? Everything works except this…