A* Pathfinding Project

Recast Graph not updating


I’ve been using Recast graphs in my project with a lot of success so far. I’ve made use of navmesh cutting. Now I’m reaching the stage where I need to start incorporating some areas of procedural terrain.

I’ve tried using GraphUpdateScene, and directly modifying by followingg the steps here: https://arongranberg.com/astar/docs/graphupdates.html#smaller-updates

Unfortunately, the terrain is completely unchanged upon calling UpdateGraphs.

There are no errors.

In my test scene, I have started with a completely flat terrain. The terrain then becomes elevated in the generated areas, along with getting lots of various objects spawned on top of it. I also tried just dragging some objects onto the still-flat terrain, and then calling UpdateGraphs. Still no luck.

What’s the best way to debug this?


A couple more notes.
If I go to the A* component, and directly rescan, it works just fine. I definitely don’t want to rescan the entire world though.

If I attempt to update through ‘UpdateGraphs’, and then go to rescan directly, it goes through all tiles, then crashes Unity when it’s close to or at the end.



That’s odd. Try to debug the bounding box that you are updating using e.g.

Debug.DrawLine(bounds.min, bounds.max, Color.red, 100);

to see if it actually shows up in the world at the right position.

That sounds like a bug. Do you have any code to replicate this issue?