- A* version:5.3.8
- Unity version: 6.1.13f1
After I Destroy() a node, it is still found by GetNearest(). Is there something I am supposed to do after using Destroy()?
I am calling GetNearest() in the same AstarWorkItem as I called Destroy()
I am calling GetNearest() in the same AstarWorkItem as I called Destroy()
Hi
As mentioned on the documentation for that method, it should basically never be called by user code. Destroy - A* Pathfinding Project
If you are trying to remove a node on a point graph, use PointGraph.RemoveNode instead. RemoveNode - A* Pathfinding Project
Thanks, I searched for Remove, and it showed RemoveAt, Remove, RemoveLink and others but no RemoveNode.
RemoveNode
is for point graphs specifically:
Doesn’t exist on other types of graphs (except another graph exclusively used by underlying code). What type of graph are you using? Also, do you mind breaking down why you specifically need to Delete/Destroy a node?
Sorry, my previous post was poorly worded. I switched to RemoveNode(), and it works fine. What I meant was that I had previously searched for “Remove” in the search box in online documentation, it returned many other Remove functions, but did not return RemoveNode(). So I tried Destroy().
Ahhh, fair! Yeah it only shows 5 options in the search dropdown so unless you know what to look for… Sorry about that