AIPath toggle repathing

I use the AIPath component on one of my units right now.
The unit has a patrol state where he searches a random control point and then he finds its way to it. Then he waits for a few seconds, looks around to find enemies and start to find a new patrol point to go to.

During its search phase i want to disable the continous repathing. How is this possible?
In addition, what is a good style here? I am using Local Avoidance as well. Wouldn’t it be enough to just calculate the path once? What is the advantage of doing constant repathing?

Best regards,
T_Schm

Hi

There are fields on the AIPath component called “canSearch” and “canMove” you can disable or enable those at any time.

The advantage of constant repathing is that if you update your graph with a new obstacle, the AI would be able to pick it up and replan accordingly. Similarly if the AI has to move away (or is pushed) from other AIs using physics or local avoidance then it can replan its path.