UpdateGraphsNoBlock broken after Astarpath.active.Scan()

Hello,

My issue is exactly as the title describes. UpdateGraphsNoBlock() works perfectly for adding and removing objects without preventing any possible path, until I call AStarPath.active.Scan(). After calling that method, UpdateGraphsNoBlock will allow me to completely block all paths between my start and finish points.

After reading through the forums, I have tried using Physics.SyncTransforms and Physics2D.SyncTransforms before the AStarPath.active.Scan() call with no luck.

Not a huge issue, I should be able to get around it by always using UpdateGraphsNoBlock and never using Scan(), but I wasn’t sure if I was missing something simple and thought you might want to know.

Using Unity 2019.4.27.f1 personal, free version of AStarPathfinding.

Hi

Do you make sure to get new nodes that you pass in to the UpdateGraphsNoBlock method?
If you re-scan the graph the old nodes will be destroyed. So if you had saved those and try to use them with the UpdateGraphsNoBlock method after they have been destroyed, you would get weird results.

This fixed it, thanks so much for your quick response! And for making this library, you’re the man!

1 Like