[Solved] Find out if new path has reached end

Hi,

I start a path with seeker.StartPath() or seeker.StartMultitargetPath().
I try to find out when the AI has reached the end of the path.

ai.reachedEndOfPath works for the first path the AI is taking. But for the second path that variable is immediately true and even after the call of seeker.pathCallback that variable (as well as ai.reachedDestination) is true.

How can I figure out if the ai already got the new path from the seeker in order to ignore the reachedEndOfPath value for that time?

Note: I cannot set the destination-property because I usually need MultiTargetPath.

Sorry, it was a fail by me.
I was refactoring a previous approach where we used destination to let our characters walk. That was set to the location of the character whenever the character stops or should stop moving.
I deleted that line and now destination is always infinity and the assigned paths are used instead every time a new path is assigned.
Now the reacedEndOfPath returns false after starting a new path :slight_smile:

1 Like