Support Forum

Removing/Deleting a node from point graph at runtime?

Hello, I’m using point graph without auto-scan/guo and adding nodes and connections manually in my project. It’s working fine but when I try to remove a node from the graph, I get the following error.

`
IndexOutOfRangeException: Array index is out of range.
Pathfinding.PathHandler.GetPathNode (Pathfinding.GraphNode node) (at Assets/AstarPathfindingProject/Core/PathHandler.cs:278)`

And this is what I do to remove node from the graph.

`AstarPath.RegisterSafeUpdate(delegate() {
PointNode someNode;
~~~
someNode.Destroy();
},true);
`

Could you tell me how you would properly remove a node?

Sorry, this is not included in the API at the moment. I have added this to my todo list.
To emulate it you can remove all connections to it and from it and set it to be unwalkable, that will for most purposes be the same as deleting it.

Thanks for the answer. That seems to work :slight_smile:

This appears to not be implemented still in 2022, is there some particularly technical reason why this isn’t implemented?