How to force update the grid graph or procedural graph mover?

Hey all, kind of a nooby question but I feel at a loss. After updating objects that should change how my grid graph is scanned and thus making some nodes walkable or not, simply calling _gridMover.UpdateGraph(); does not update the changed nodes (tried both sync and async). I breakpointed inside my custom grid rule and it never gets hit after making this call. I also tried Is there a really obvious method I’m missing that can help me do this?


The ProceduralGraphMover makes great effort into only recalculating the nodes that need to be recalculated after it has moved the graph. So it will only recalculate the nodes around the borders of the graph. If you have changed something in a grid rule you’ll need to do a regular graph update: box). Or re-scan the whole graph if your changes will affect everything (

Also keep in mind that grid graph rules have an internal hashing function that avoids running some parts of it unless the settings have changed. Call rule.SetDirty() to invalidate it.

1 Like

thanks for responding so quickly, the bounds update wasnt working as expected, neither the async update, but im happy i got it working at all!

here’s the code i used hoping it helps someone else:

            var active =;

            //active.UpdateGraphs(bounds); // doesnt work for some reason

            if (active != null && active.graphs.Length > 0
                && active.graphs[0] is GridGraph grid)
                var rules = grid.rules.GetRules();
                foreach ( var rule in rules )

That probably works because it calls rules[i].SetDirty() under the hood. I’d recommend calling that directly instead of disposing the unmanaged data, as this could cause crashes if an async scan was running at the same time.

1 Like

i missed the GetRules method :sweat_smile: thanks for pointing that out, updated the previous code