PSA - astarPathfinding Use of SetDestination in MoveTo task

bbjones

Member
FYI I was getting warnings like this: Path Failed : Computation Time 0.00 ms Searched Nodes 0

Turns out it was because SetDestination was being called to quickly.

I had to make 2 changes to the MoveTo task:
- Remove the call to SetDestination in Start()
- Modify the underlying SetDestination method to check if a path was pending

protected override bool SetDestination(Vector3 target) { if (agent.pathPending) return true; agent.canSearch = true; agent.canMove = true; agent.destination = target; agent.SearchPath(); return true; }

At one point I was getting so many warnings that it was actually breaking the pathing of my AI.
Link to thread on astar forums: https://forum.arongranberg.com/t/path-failed-computation-time-0-00-ms-searched-nodes-0/13499
Main point of interest from Aron:

This is most likely because you are calling ai.SearchPath() faster than the agent can calculate its path. If a path request is pending when ai.SearchPath is called, then the previous path request will be aborted. You can check if a path is pending using ai.pathPending.
 
Thanks! I've updated the integration package.
Could you please also add version number(or date stamp in file name) to integration packages and send some announment if they has been updated?
Sometimes good fix like mentioned in this post may happened silently and we didn't aware that.
 
I can ask our web developer about this but right now that's not currently possible. For every Behavior Designer release I make sure to mention the updated integrations within the release notes.
 
Top