Turning RVO on/off at runtime causes some pretty random behaviour

Is it bad to toggle the enabled flag of the RVO script? I want my agents to only use RVO when standing still, so each time they stop I activate RVO, and each time before they start moving I disable it. But this causes agents to sometimes not go to their destinations (I can see the correct path is calculated using gizmos, but agent does not start moving).

Seems to be random as well can’t find a pattern so wondering if it’s simply not made to support this? If not, How can I achieve what I need?

bumping this @aron_granberg, is there some way to have agents disable RVO when moving and enable it again when standing still?

Quite similar to how lockWhenNotMoving works except I want to have it be enableWhenNotMoving. When I simple enable/disable the RVO component at runtime I run into the issue described above.


Sorry for the late answer.
Which version are you using? You might want to try the beta version as the local avoidance system has been heavily rewritten in that version.

I am using 4.3.43, I read the other ones require unity 2020.2.

Can you recreate this issue at all? It’s one of those horrible bugs that happen like 5% of the time. Unfortunately it forces me to completely remove RVO which is a shame since that is why I got this asset. Its impossible to create neat unit formations if you cannot disable RVO on the units that are moving, and lock it for the ones that are still. Might be a nice flag to add to the rvo inspector window? :slight_smile:

If you keep RVO enabled on the movers, there are too many scenarios where they simply get stuck on the locked ones.

I faces somewhat similar issue. Try disabling stop agen when stucked property. I also don t understand why you are enabling rvo only when they are moving. There’s Lock property available

I am not, I am disabling RVO when they are moving. If I dont the options are:

  1. Keep RVO on but dont lock on units standing still - this leads to units in formation being pushed and ruining the neat formation.
  2. Keep RVO on and lock units standing still, this often leads to units that are walking to their position in the formation getting stuck because the units around it already reached their positions and locked.

Only option left is my solution and it works perfectly apart from the 5% where they dont start walking to their destination even though I can see they have the path if I debug.


Hmm, I think I figured out this. It seems to be a race condition. So if the path is calculated within 1 frame then all is well, but if it takes 2 frames then they may not start to move until they after a few seconds (is this what you are seeing as well?).
I could however, not replicate any bug related to enabling/disabling the rvocontrollers. This bug was there all the time.

1 Like