How to move node of GridGraph on runtime?

I know that GridGraph creates what it says - a grid.

But can I move SOME nodes or just one node slightly with code during runtime?

Something like:




You can technically move a grid node, it may throw off some algorithms a bit (like linecasting on a grid), but generally I think it should work.

// We must only update the graph when it is safe to do so
// The callback will run once the pathfinding threads have been stopped
AstarPath.RegisterSafeUpdate(() => {
    var node =;
    node.position = (Int3)new Vector3(20,0,14);

// Optionally force the above callback to run immediately
1 Like