A* Pathfinding Project

Moving with navmesh


#1

Is somehow possile o teleport whole (cashed) navmesh to different location (only one time on start of the scene)? I found your example with local space navmesh, but problem is that navmesh gizmo stays in previous location and it is hard to debug.


#2

Hi

If you want to move the whole navmesh you can use

AstarPath.active.graphs[0].RelocateNodes(someMatrix);

See https://arongranberg.com/astar/docs/navgraph.html#RelocateNodes2

Note that the individual graph types have some overloaded methods that are recommended to use

For recast/navmesh graphs this one is recommended
https://arongranberg.com/astar/docs/navmeshbase.html#RelocateNodes2

For grid graphs this one is recommended
https://arongranberg.com/astar/docs/gridgraph.html#RelocateNodes2