I'm working on a random patrol function

Hello! I’m working on a random patrol function, but I’ve encountered an issue. I designate the next point after completing the movement to the current point. However, when I choose a point that is unreachable, I’m unable to detect the completion of the path, which prevents me from setting the next point. How should I solve this problem?

image

Hi

You can check ai.reachedEndOfPath to see if the agent cannot progress anymore on the current path. That’s probably more useful compared to ai.reachedDestination for a patrol script.