I am having some issues understanding root motion and how it applies to animations build in Unity (I.e. the animations are NOT imported with the model but are build in Unity’s animation editor)
Basically, the root node is moving and rotating alright, but this motion is never applied
to the parent game object (where the Animator lives), so it always stays in the same place.
I have an almost identical setup with another model where the animation is imported with the
mesh and that works fine.
Both the working and the broken model has the same basic hierarchy:
+ prefab (Basically a Transform with Animator Component)
+ root
+ bones (Bones-hierarchy)
+ renderer (Node with SkinnedMeshRenderer Component)
The Rig is imported like:
Animation Type: Generic (Also tried all the other options, no difference)
Avatar Definition: Create From This Model
Root node: root
Skin Weights: Standard (4 bones)
Optimize Game Object: No
The Animator is setup like
Controller: SomeController
Avatar: SomeAvatar (generated, but also tried picking an avatar from a different model)
Apply Root Motion: Yes
Update Mode: Normal (tried all)
Culling Mode: Cull Update Transforms (but I’ve tried all)
There are several animations in the controller, and only two of them has root
motions. One has root:Position keys and the other has root:Rotation keys. I can
see that the root node transform is updating these properties when animating. And all
animations as well as the controller is working fine other than root motion not being applied.
I was trying to see if I could get it working from code using OnAnimatorMove and
ApplyBuiltInRootMotion and noticed that
animator.runtimeAnimatorController.animationClips[×].hasRootCurves
is false for all clips. It seems to me that somehow the connection between the
specified root node in import settings and the root keys in the animation is
lost?
(Oh, and this is Unity2019.3.8f1)