How create pointGraph nodes at runtime

How can I add nodes to PointGraph at run time?
(please give me snippet of code)

something like:

PointGraph.addNodeNowAt(20, 0, 20);

thanks

1 Like

Hi

// 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 graph = AstarPath.active.astarData.pointGraph;
    var node = graph.AddNode(new Vector3(20, 0, 20);
}

// Optionally force the above callback to run immediately
// AstarPath.active.FlushThreadSafeCallbacks();
1 Like

Thats what I needed!
Thanks!