Unity Character Animation: Motion Capture Integration Guide

Unity Character Animation: The Complete Pipeline

Unity's character animation system is one of the most developer-friendly in any game engine. The Humanoid rig abstraction handles retargeting automatically, the Animator Controller scales from simple to complex, and the Blend Tree system covers most locomotion needs without custom code. This guide walks through the complete pipeline for getting motion capture animation into a Unity rigged character and building a production-ready animation system.

Unity's Animation Architecture

Unity character animation has three main layers:

  • Animation Clips — individual animation sequences imported from FBX. Each clip records skeleton movement over time.
  • Animator Controller — the state machine that decides which clip plays when. Contains states, transitions, and parameters that your game code drives.
  • Animator Component — the runtime component on your character GameObject that runs the Animator Controller against the character's skeleton.

The Humanoid rig sits underneath this system as an abstraction layer. Configure a character's skeleton as Humanoid and Unity maps the bone names to a standard avatar definition. Any animation configured as Humanoid then works on any Humanoid rigged character automatically — this is how Unity handles retargeting transparently without manual chain mapping.

Importing Motion Capture FBX into Unity

  1. Drop the FBX into your Project panel. Unity imports it automatically.
  2. Select the imported asset and go to the Rig tab.
  3. Set Animation Type to Humanoid.
  4. Click Configure to verify the bone mapping — Unity auto-maps standard bone names. Correct any bones that did not map correctly.
  5. Click Apply, then go to the Animations tab.
  6. For locomotion clips, enable Loop Time and Loop Pose.
  7. Set Root Transform Rotation to Bake Into Pose for most locomotion.
  8. Click Apply.

If importing multiple FBX files for the same character, assign the same Avatar Definition (Copy From Other Avatar) so all clips share the same bone mapping. MoCap Online's Unity format packs are pre-configured for Unity's Humanoid rig — loop settings and root transform are already set correctly, so you can skip most of this configuration.

Building the Animator Controller

Right-click in the Project panel and select Create → Animator Controller. Add Float, Bool, and Trigger parameters to drive transitions — Speed, IsGrounded, and Land are a good starting set for locomotion.

Create a Blend Tree for locomotion by right-clicking → Create State → From New Blend Tree. Set the parameter to Speed and add Idle at 0, Walk at 0.3, and Run at 1.0. Enable Loop Time on each clip.

Add Jump, Fall, and Land states. Transition from Any State to Jump when IsGrounded is false. Transition from Jump to Fall when vertical velocity drops below zero. Use the Land trigger to transition back to locomotion.

On speed-driven transitions, uncheck Has Exit Time so they respond immediately to input. Set blend time to 0.15–0.25 seconds for smooth crossfades. See the animation blend tree guide and animation state machine guide for full setup detail.

Driving the Animator from Code

In your character controller script, update Animator parameters every frame:

void Update() {
    float speed = controller.velocity.magnitude;
    animator.SetFloat("Speed", speed, 0.1f, Time.deltaTime);
    animator.SetBool("IsGrounded", controller.isGrounded);
}

The third and fourth arguments to SetFloat apply smoothing — they prevent jitter from frame-by-frame velocity fluctuations. A dampTime of 0.1f is a good starting point.

Avatar Masks for Independent Body Layers

An Avatar Mask defines which bones a given Animator layer controls. Without masks, each layer drives the complete skeleton. With masks, a base layer runs full-body locomotion while a second layer runs an upper-body reload or aim animation at the same time. The lower body plays the run cycle uninterrupted while the upper body performs the weapon action.

To create a mask: right-click in Project, Create → Avatar Mask. Green bones are controlled by the layer; red bones are not. Assign the mask to the layer in the Animator window's Layers panel. Set Layer Weight to 1 and Blending to Override or Additive depending on whether the layer should replace or add to the base layer's pose.

Animation Events for Frame-Accurate Game Logic

Animation Events fire function callbacks at specific frames in a clip — exact heel-contact for footstep audio, the throw-release frame for projectile spawning, or the impact frame of an attack for particle effects. Without Animation Events, developers use time-based coroutines that accumulate timing drift.

To add one: select the FBX in the Project panel, go to the Animation tab, scrub to the target frame, click "Add Event," and enter the function name. The method must be public on a script attached to the character's root GameObject.

Unity Animation Rigging for Procedural Layers

Unity's Animation Rigging package (available in the Package Manager) provides a node-based system for additive procedural layers on top of motion capture. Key rigs for character animation include Two-Bone IK for foot planting on uneven terrain and hand-to-object attachment, Multi-Aim Constraint for head and spine look-at, and Chain IK for spine bending toward a target. These procedural layers add believability on top of standard mocap clips without requiring additional capture data.

Debugging the Animator Controller

Unity's Animator window includes a live debug mode that shows active state weights and transition progress during play mode. Enabling it reveals which states are active, which transitions are in progress, and what the current parameter values are.

Common issues visible in debug mode: a transition condition that never becomes true because a parameter is not being set by the character controller, and a state that receives control but immediately transitions away because exit time is set too low. Blend tree weights that do not reach their intended extremes indicate that the parameter range does not match the blend tree axis range — check the blend tree's axis min/max against the character controller's parameter output range.

Getting Started with Unity Character Animation Packs

MoCap Online's Unity animation packs are delivered pre-configured for Unity's Humanoid rig with loop settings already applied — ready to populate an Animator Controller immediately. Download a free sample pack to test compatibility with your character before purchasing a full set.