Animation Intermediate

A great avatar is only as good as its animations. In this lesson, you will set up Animator Controllers with state machines and blend trees, configure animation retargeting for Ready Player Me avatars, and implement inverse kinematics for natural body movement.

Animator Controller Setup

Create an Animator Controller with a locomotion state machine. Ready Player Me avatars use the Unity Humanoid rig, which means any Humanoid-compatible animation clip can be retargeted automatically.

  1. Create the Controller

    Right-click in the Project panel → Create → Animator Controller. Name it "AvatarAnimator".

  2. Add a Blend Tree

    In the Animator window, right-click → Create State → From New Blend Tree. Set the blend parameter to "Speed".

  3. Assign Animation Clips

    Add Idle, Walk, and Run clips to the blend tree. Set thresholds at 0, 0.5, and 1.0 respectively.

Animation Retargeting

Because Ready Player Me avatars are exported as Humanoid rigs, Unity's animation retargeting system works out of the box. Ensure your animation clips are also imported with the Humanoid rig type and the avatar definition is set correctly.

Mixamo Tip: Mixamo provides thousands of free Humanoid animations that work perfectly with Ready Player Me avatars. Download animations in FBX format without skin, import into Unity, and set the rig to Humanoid.

Inverse Kinematics

Use Unity's built-in IK system for natural hand placement, head look-at behavior, and foot grounding. Enable IK Pass in your Animator Controller layer settings and implement OnAnimatorIK() in your script.

C#
private void OnAnimatorIK(int layerIndex)
{
    if (lookAtTarget != null)
    {
        animator.SetLookAtWeight(1f, 0.3f, 0.6f, 1f);
        animator.SetLookAtPosition(lookAtTarget.position);
    }
}

Layer-Based Animation

Use Animator layers to combine full-body locomotion with upper-body gestures. Set the upper-body layer to use an Avatar Mask that isolates the spine, arms, and head. This lets your avatar walk while waving or pointing independently.