A* Pathfinding Project

SeekerComponent.pathCallback gets called more often than when it reaches its destination


#1

https://arongranberg.com/astar/docs_dev/class_seeker.php

Trying to use pathCallback to know when my character has reached the end of its path. This description sounds like it should call when it reaches (or goes as far as it can to) its destination. I’ve also tried looking at Seeker and debug.logging its OnPathComplete function. Seems to call a couple times per second in both cases.


#2

Step One: Look around the scripts, try to solve it yourself.
Step Two: Search on google and the forums.
Step Three: Finally just post asking the question.
Step Four: Find the answer literally on the same forum you just searched and feel foolish for having posted.

reachedEndOfPath did it for me. Thanks!

[edit] However, it seems to be walking for quite a bit after this flag becomes true.


#3

Hi

Yeah, reachedEndOfPath or reachedDestination (recommended) are better than the OnPathComplete function for this purpose.
You can adjust how close to the destination the agent needs to be for it to consider it reached by changing the “end reached distance” field on the AIPath/RichAI component.