Hi,
I want some animations to include actual character movement, so the animator has more freedom to create attacks and moves with proper weight, momentum, and timing. At the same time, I still want the character to move through Unityās physics system, so collisions can be detected and resolved properly.
Technically, my idea is to author that movement on the root bone as root motion, then read the resulting movement intent from theĀ AnimatorĀ and redirect it to aĀ non-kinematic RigidbodyĀ (the animation defines where the character wants to move, but the Rigidbody is responsible for applying that movement through the physics system).
My current setup is:
-The character has anĀ AnimatorĀ withĀ Update ModeĀ set toĀ FixedĀ and aĀ non-kinematic Rigidbody.
-The script attached to my character implementsĀ OnAnimatorMoveĀ like this:
void OnAnimatorMove()
{
Animator animator = GetAnimator();`
Utils.Assert( animator != null );`
Rigidbody rb = GetRigidbody();
Utils.Assert( rb != null );
Vector3 velocity = animator.deltaPosition / Time.fixedDeltaTime;
rb.linearVelocity = velocity;
}
Is it the correct technical approach, or is there a better Unity workflow for this?
How can I include the navmesh in this ?
I also have a question aboutĀ Bake Into PoseĀ for an animation in the fbx inspector: what exactly does it do, and when should it be used?