Help: deltaPosition magnitude - where is this value set ?

Hello,
I need some help. I have done the tutorial ‘John Lemon Haunted…’, works fine.

now I try to get my model to run and use the script from the tutorial. But my model only rotates and doesn´t move.
i played around a bit and found out that the deltaPosition.magnitude value seems to be zero, when i remove the value from the script my model move but with really big steps.

m_Rigidbody.MovePosition (m_Rigidbody.position + m_Movement); // * m_Animator.deltaPosition.magnitude)

I have not found out where the value is set ? what does the Animator have to do with it and how can I set or adjust this value ? ‘Who’ is setting thsi value ?
In the documentation for deltaPosition it only says that RootMotion has to be enabled but my model says ‘root motion handled by script’.
I have also compared the models from the tutorial and mine but have not found out where this value comes from.

Can someone help me and/or maybe give a hint how I can solve this without this value.
Thanks
Ralf

The deltaPosition property of the Animator returns the root motion that comes from the animations that are currently playing on the animator. As you can read in the documentation it only returns a value when apply root motion is enabled in the animator. Apart from that the used animations need to have root motion in order to apply them.

Root motion means that the walk / run animation actually moves the root bone. This root motion is usually removed by the animator since the object should not move away from it’s own origin. So the animation itself is played “on the spot”. With the deltaPostion you can essentially extract this relative motion and apply it manually through the physics system.

Thanks for the answer.
I think I understand now, this value is derived from the animation. If I look at the corresponding animation
then the “root” should be moved there. Otherwise, I can also ignore this value and find out and set the
appropriate value for my model.
If I understand this correctly, this value only makes sense if different animations cover different distances, right ?
Otherwise a fixed value is sufficient.
Ok, I will check this part of the documentary again.
greets

Exactly :slight_smile: Having root motion makes it easier to avoid “slipping” (assuming the translation in the animation is perfectly set up by the animator). It will also ensure that if your animation speed is changed the translation is always in sync with the actual animation.

thanks,
how can i close this thread or mark as solved ?