Precise placement of agent at the end of the path

Hi, I have a situation that I’ve been trying to solve for quite some time now, and I must confess it’s become an exercise in patience. I’m working on a tactical RPG where precise agent placement is paramount, but for some reason my code always misses the target by a small fraction, which ends up placing the RVO agent a little bit after the end point – not only that, actually: since the actor has crossed the end point by a small amount, it rotates to meet the true target point, putting the character into a direction completely different from what was intended.

Narrowing down the possibilities, I found out that the movement doesn’t stop exactly when I say it to stop – it still continues for one or two frames after that. To stop the agent movement I’m doing this:


And the agent insists moving a little bit after that.

What should I do to ask the agent to stop and make sure that it will stop at that exact moment, without the extra movement after that? One thing I’ve tried was putting this code inside LateUpdate() instead of Update(), but nothing changed.

(I’m using RVO controllers and NavMesh.)

Thanks and best regards,


You could enable the RVOController.locked field, that will completely prevent it from moving.
You can also try to increase the simulation fps on the RVOSimulator component to make it slightly more accurate, and also disable double buffering to remove the 1 frame latency introduced by it.