After upgrading to 2018.3 I’ve noticed that Animator Root Motion behaves differently. Having the “Apply Root Motion” disabled in the Animator Component, no longer disables the translation of the root bone. Possibly related to this from the release notes of 2018.3:
I would like to know if there is another way to disable root motion if this really is a new feature and not a bug.
2018.2 (root stays in place)
FalseCheeryAllosaurus
2018.3 (root moves forward and then resets back to the origin)
PositiveBarrenApatosaur
Reproduced with a clean project with only the character imported running in 2018.2.14f1 followed by a direct upgrade to 2018.3.2f1. The rig of the animated characted looks like this:
Hey @marcpeyre ,
Pre-2018.3, our implementation of Root Motion was a bit inconsistent.
- Playing an animation with curves on the Root Transform with “Apply Root Motion” OFF would move the Root Transform, but playing the same Animation with “Apply Root Motion” ON would not move the Root Transform at all
- Playing an animation with a Root Transform defined in the Rig (with Root. curves in the clip) with Root Motion ON would move the object, but playing the same Animation with “Apply Root Motion” OFF would give an Animation that is neither the clip from the file nor the Root Motion result, but something weird in-between.
In 2018.3, we’ve unified things so that the results are always coherent.
- Playing an Animation with “Apply Root Motion” ON will apply animation on the root joint incrementally, either using Root Transform curves (e.g.:“m_LocalPosition”), Root Curves (e.g.: Root T and Root Q), or Motion Curves (Motion T and Motion Q)
- Playing an Animation with “Apply Root Motion” OFF will apply animation just like the source file
The previous behaviour that you were relying on (Root T and Root Q with “Apply Root Motion” OFF), was exactly the same as having “Apply Root Motion” ON and overriding OnAnimatorMove without applying the Root Motion.
This behaviour doesn’t directly exist anymore, but you can reproduce it by implementing your own OnAnimatorMove. I’ve attached a script to this email that shows how to do it. You should be able to get exactly the same behaviour by changing the enableRootMotion property of this script instead of changing “Apply Root Motion” on the Animator.
4129507–363160–RootMotion.cs (443 Bytes)
3 Likes
This post saved us time while the root motion change already cost us hours.
I’m also having this issue, however your script doesn’t seem to solve my problem. Since updating to Unity 2018, my animator.deltaPosition returns (0, 0, 0) everytime OnAnimatorMove() is called. Has this delta position value changed too?
private void OnAnimatorMove()
{
if (animator == null)
animator = GetComponent<Animator>();
if (enableRootMotion)
{
animator.ApplyBuiltinRootMotion();
CharacterController.AnimatorMove(animator.deltaPosition, animator.deltaRotation);
}
}
Edit: The rig is humanoid, and from the “TwinBlades Animset Base” from the asset store
I also can’t find how to make a custom OnAnimatorMove and use the deltaPosition in Unity 2019.1 0f2, it’s stay at 0,0,0 when i try.
Is it not possible anymore to disable root motion on the AnimationController and read what the root motion would have been in a OnAnimatoMove method ?