Answered

Having trouble with root motion

Adrian Taylor 4 years ago updated by Peter - Soxware Developer 4 years ago 1

I think the problem I'm having comes from my [lack of] understanding of how root motion works.

I have created an animation in UMotion where a  humanoid character gets up from a seat and turns 180 degrees. Using the Mechanim system in Unity, I then want to transition into a walk cycle.The issue I'm having is that the character root does not seem to move with the character, and when I transition into the walk state, the character first snaps back to the original pose, then continues to walk off in the wrong direction.

Here are some screenshots which should illustrate my issue (note that the character is selected so you can see his transform gizmo:

1: First frame of animation:

Image 307

Stand up animation:

Image 308

Stand up animation continued:

Image 309

Last frame of stand up animation:

Image 310

After transition to walk:

Image 311

After a few seconds of walk animation... note how the transform sticks with the character as he walks. This is what I was expecting would happen with the stand up animation that I created with Umotion:

Image 312

I have tried various combinations of toggling the apply root motion option on the animator component, as well as baking root motion into the exported UMotion animation (both with unity and the experimental option in the UMotion clip editor settings).

UMotion Version:
1.22p03
Unity Version:
2.19.3.3f1

Answer

Answer
Answered

Hi,

thank you very much for your support request.

To debug this, I recommend to divide your problem into two steps:

1) Let's see if your standing up animation correctly uses root motion. Enable looping (in the exported *.anim file's Inspector) and make sure "Apply Root Motion" is also enabled in the Animator component. Then play the animation twice: Your character should stand up, turn 180°. Then at the current position it should sit down (but keep the current position/orientation).

If this doesn't work, you may want to check the root motion settings in the Inspector of your *.anim file.

Setting everything to "Original" and disabling "Bake Into Pose" might work (haven't tested this though).

2) Once you got (1) working, add the transition to it. If the transition doesn't work, then chances are that your second animation's root motion settings are incorrect (check the *.anim file's Inspector).

Here is Unity's documentation of the root motion settings: https://docs.unity3d.com/Manual/class-AnimationClip.html#ClipProperties

If you have issues with small offsets of the root motion, use UMotion's experimental root motion export. Enabling Unity Mecanim/Animator IK can also improve the re-targeting quality (especially for the hands to reach the front seat precisely).


Please let me know in case you have any follow-up questions.


Best regards,
Peter

Answer
Answered

Hi,

thank you very much for your support request.

To debug this, I recommend to divide your problem into two steps:

1) Let's see if your standing up animation correctly uses root motion. Enable looping (in the exported *.anim file's Inspector) and make sure "Apply Root Motion" is also enabled in the Animator component. Then play the animation twice: Your character should stand up, turn 180°. Then at the current position it should sit down (but keep the current position/orientation).

If this doesn't work, you may want to check the root motion settings in the Inspector of your *.anim file.

Setting everything to "Original" and disabling "Bake Into Pose" might work (haven't tested this though).

2) Once you got (1) working, add the transition to it. If the transition doesn't work, then chances are that your second animation's root motion settings are incorrect (check the *.anim file's Inspector).

Here is Unity's documentation of the root motion settings: https://docs.unity3d.com/Manual/class-AnimationClip.html#ClipProperties

If you have issues with small offsets of the root motion, use UMotion's experimental root motion export. Enabling Unity Mecanim/Animator IK can also improve the re-targeting quality (especially for the hands to reach the front seat precisely).


Please let me know in case you have any follow-up questions.


Best regards,
Peter