I’m trying to implement a wander action. I was wondering how to properly combine AIPath and RandomPath behaviour.
I have an agent that runs on a custom class inherited from AIPath most of the time. Occasionally I would like it to wander and found out about RandomPath.
However, I don’t know what to do with the path returned by RandomPath.Construct. I tried giving it to the Seeker component via StartPath and it does seem to work for a while but then it gets interrupted by the AIPath’s destination recalculation (which I have set to 0.5 seconds) because the actual “destination” variable doesn’t change.
What is the intended way to solve this? I can only think of workarounds.
The recommended way to do this is to use the AIPath’s SetPath method along with setting ai.canSearch to false to prevent it from recalculating its path automatically.