I’ve tried to implement the updategraphsblock into my TD game using the documentation, my question is has anyone had any luck with it working and if so could they provide a example of it working and maybe the class they had it in because i don’t fully understand how to use it at this time.
Thanks in advance.
Hi
First try to see if you can get the graphs to update using a normal graph update using scripting.
See http://arongranberg.com/astar/docs/graph-updates.php
What the UpdateGraphsNoBlock function does is that it updates the graph using the graph update you supplied, then it checks if there is still a valid path between the two (or more) nodes that you specified. If there is a valid path, it will just return, otherwise it will revert the graph update and return false.
You can get the node from a Vector3 using
var node = AstarPath.active.GetNearest (somePosition, NNConstraint.Default).node;
The NNConstraint.Default argument is there to make sure that the returned node is walkable (e.g not inside a wall or similar).
I don’t have a full example here, but is there something specific that you cannot figure out?