RVO with RootMotion

Hi! I trying to use pathfinding with local avoidance and rootMotion.

I use next code in Update:

Vector3 nextPosition;
Quaternion nextRotation;

agent.MovementUpdate(Time.deltaTime, out nextPosition, out nextRotation);

var curSpeedAnim = animator.deltaPosition.magnitude / Time.deltaTime;
rvoController.SetTarget(agent.destination, curSpeedAnim, curSpeedAnim * 1.2f, agent.endOfPath);

var offset = rvoController.CalculateMovementDelta(root.position, Time.deltaTime);
root.position += offset;

root.rotation = nextRotation;
agent.FinalizeMovement(root.position, nextRotation);

But with agents are moving more quicker than animation movement speed. And in this reason they are moving with slips.
How can I use rvoController.CalculateMovementDelta for correct result?

Hi

Root motion and RVO are arch enemies. RVO requires full control over the velocity, and root motion also requires full control over the velocity. This means that they mesh really badly, and one of them usually has to give. I have not found a satisfactory way to combine them at the moment.

1 Like

Hi! Thanks for answer.

RichAI have opportunity to get calcuated velocity for agent if CanMove set to false? I want translate it to Animator.
In my case richAI.desiredSpeed returning (0, -1.7, 0) always.

Hi

Yes, you can use IAstarAI - A* Pathfinding Project

You may also be interested in looking at the MecanimBridge script, which does a similar thing.