I have a script that makes the agent move between points in a path (setting the destination on the FollowerEntity component). They should stop for 1 second on each point and then continue on to the next point. It works fine as long as i dont set isStopped to true. When I do that, as I want the agent to stop at each point, then they start to interact with each other really weird, its like its trying to move out of the way but the the velocity is off of something as it just sliiiides away. Could it be that the FollowerEntity actually has to be active to “decellerate” the velocity correctly when the avoidance velocity gets applied?? Seems like a bug to me, but I dont know. The docs says:
Gets or sets if the agent should stop moving.
If this is set to true the agent will immediately start to slow down as quickly as it can to come to a full stop. The agent will still react to local avoidance and gravity (if applicable), but it will not try to move in any particular direction.
I would like to think that the agents should avoid each other as the are all trying to get to the same point, but they should not slide away like this.
Would you be able to debug if their speed is constant after they’ve “stopped”? Maybe I’m losing it but it almost looks like they’re slowly deaccelerating. And if it is, then it’s likely something different than the isStopped. You may also want to check the Follower Entity’s debug info for anything else that looks reflective of this issue.
Actually, out of curiosity, why are you using isStopped? I’d imagine just setting the destination to the point and not stopping them would provide the same effect. What’s your use case here?
I did some investigation and the speed is already stopped, but it is still moving. Yes, it is decellerating, but its not any of my own script doing it. It is not happening if there is only 1 agent, but as soon as there are 2 I can clearly see that there is some kind of avoidance behavior happening and its like when its arrived at the destination and i set isStopped to true it is simply just affected by the avoidance part, but the avoidance part (this is my guess) is just an add on, so it gets weird when the general ai path finding is inactive, but it still have some velocity from earlier that it might be acting on, or something.
Any way. The solution for me was, just like you suggested, to simply not stop the agent, just dont touch the destination.
This can produce some issues though, as if lots of agent want to get to exact same point, they never settle down and stop, so then I have to handle that some other way. It would have been nice to be able to use stop, and then only have avoidance running (correctly) and let the agents gather around some point with keep trying to get into the middle of the crowd.
You can access when they’ve reached a possible crowded destination with reachedCrowededEndOfPath. From there you can pretty much do whatever with them-- like remove their path so they just “stay there”. I also found some success in my own testing by just setting stopDistance higher.