Support Forum

RVO with Root Motion

Hello !
We are trying to implement Local Avoidance with Root Motion objects.
But we don’t know where we should start with RVO or if it’s even possible to do with Root Motion.
@aron_granberg can You give some advice how to handle RVO with Root Motion ?

Best

Any advice @aron_granberg ? :slight_smile:

Thanks

Hi

RVO and root motion are sadly two techniques which work very badly together. The reason is that root motion wants to have full control over how the character moves (and only allows it to move in specific and usually relatively limited ways), while RVO also wants full control over the character’s velocity and requires it to be able to change its velocity instantaneously. This requires a compromise somewhere.
Sadly, I have not found a, in my opinion, satisfactory solution for this. One option is to decouple the agent’s position from the transform’s position (ai.updatePosition = false, ai.updateRotation = false) and try to make the root motion follow what the ai is doing as closesly as it can, but that’s not trivial to get to work well.

Hi, So basically there is no option to use RVO and Root motion together? I meah I have a case when I want to use root motion for Attack, and I want other Agents to avoid That Melee agent and not intersecting with it. Is it possible?

Sorry. Root motion and RVO really do not want to work together. They have opposing requirements.
What some games do is that they use root motion only when local avoidance is not particularly important.

I understand. And do you know how Unity Navigation handles it?
Because in my previous game I used root motion by setting vevlocity in OnAnimatorMove
and the enemies didnt collide with each other. Was it the Physics system preventing it?