Got a small question that I can’t seem to figure out. I have a task system, so every time the AI get somewhere, I give a callback. And than the AI get the next position from the task manager.
I’m using ai.destination = targetPosition;
Problem is, once the first path is finished, ai.hasPath keeps giving true. I would like to “clear” the path once arrived. That way, the AI doenst keep looking (He is allready on the target) and I can start a new path once one is availeble in my taskmanager.
I also tried checking ai.reachedEndOfPath on an update, but of course it takes a few frames to calculate, so the check in my update keeps giving true, from the previous path.
Any help would be appreciated