Objects that use RVO are stuck when used from an object pool

Hi there :slight_smile:

I have the following problem that I hope you can help me with:
I use the AiPath with the RVO Controller for gameobjects that are pooled and frequently enabled/disabled. Upon the first enable of these objects, the pathfinding works completely fine.

When I reenable the objects again, the objects are frozen at their starting position for some moments and I can’t figure out what is causing this behavior (once the objects move, the pathing / avoidance is correct). When I use these pooled objects, I manually enable the RVO Controller upon activation of the gameobject. The RVO Controller is also disabled shortly before the objects are disabled (to allow some animation to play out).

Further detail: When I don’t use the RVO Controller, the pathing works fine and without any delays (however without the local avoidance)

I also tried the following variation of the sequence for some troubleshooting:

  • Gameobject is drawn from the pool for the first time: RVO Controller is enabled
  • Pathing / Avoidance is correct
  • Gameobject is disabled and the RVO Controller is also disabled
  • Gameobject is drawn from the pool for the second time: RVO Controller is NOT reenabled
  • Pathing also starts with a delay

So I guess the problem lies with some data within the AiPath component as the delay also occurs when the RVO Controller is not reenabled?

Do any of you have any idea what this could be due to? Any help is greatly appreciated.

Many thanks in advance :slight_smile:


You mention “some moments”. How long are we talking about?

1 Like

Hey there - thanks for taking your time :slight_smile:

Those were 2 seconds. However, I figured out this was related to the repathing rate (I was upgrading the package from a previous version). Nevertheless, the delay even appears when I set the path when the object is enabled and I want to apply a pre-calculated path via ai.SetPath(_inputPath).

A workaround but inefficient way to resolve this problem would be to set the repathing-rate to something like .2 seconds but that doesn’t feel correct.