Unity animation rigging: IK constraint chain with teal target handles and bone hierarchy overlay

Unity Animation Rigging: Procedural Animation Guide

What Is the Unity Animation Rigging Package?

The Unity Animation Rigging package is a runtime procedural animation system that lets you layer constraint-based bone manipulation on top of your existing animation data. Rather than replacing your keyframed or motion-captured animations, it extends them — correcting foot placement on uneven terrain, keeping hands on surfaces and handles, directing aim at targets, and creating secondary motion on tails and loose limbs without requiring additional keyframe work.

The package ships as an official Unity package maintained by Unity Technologies. Install it via the Package Manager: Window > Package Manager > search "Animation Rigging" > Install. It requires Unity 2019.4 or later and works with both the built-in render pipeline and URP/HDRP.

This guide covers every major constraint type, walks through the most important setup scenarios step by step, explains how to combine constraints into a multi-layer rig, and documents performance considerations and common mistakes.

The Core Concept: Rig Builder and Rig Layers

Before diving into individual constraints, understand the architecture:

  • The Rig Builder component sits on your root Animator GameObject. It holds a list of Rig layers and executes them in order after the Animator updates poses.
  • Each Rig is a child GameObject with a Rig component and any number of constraint components attached to its children.
  • Constraints run in order within each layer, and layers run in order within the Rig Builder.

This means you can stack rigs: Layer 1 might handle full-body locomotion corrections (foot IK), Layer 2 might handle aim, and Layer 3 might handle hand IK for specific interactions. Each layer is independently weighted and can be blended in and out at runtime.

Two Bone IK Constraint

What it does: Solves a two-bone chain (thigh-calf-foot, upper arm-forearm-hand) to reach a target position in world space. The most commonly used constraint in the package.

Key parameters:

  • Root, Mid, Tip bones — the three bones in the chain (e.g., UpperLeg, LowerLeg, Foot)
  • Target — a Transform the tip bone will try to reach
  • Hint — a Transform that guides which direction the middle joint bends (knee direction, elbow direction)
  • Weight — 0 to 1 blend from the original animation pose to the IK-solved pose

Primary use case — Foot IK: Place a target Transform at the character's foot position in the base animation. Drive that target's world position using a raycast (Physics.Raycast downward from the character's hip) to snap it to the terrain surface. At weight 1.0, the foot will plant exactly where the ray hits regardless of ground height. See the full foot IK setup section below.

Primary use case — Hand IK: Place a target Transform at a weapon grip point or ledge. Animate the target's position to match the intended interaction. The Two Bone IK constraint solves the arm to reach it cleanly.

Multi-Aim Constraint

What it does: Rotates a bone to aim one of its local axes toward a target object, with configurable axis weights and limits.

Key parameters:

  • Constrained Object — the bone to rotate (head, spine, weapon barrel)
  • Source Objects — one or more targets to aim at (can blend between multiple)
  • Aim Axis — which local axis to point toward the target (typically the bone's forward axis)
  • Up Axis — the secondary axis used to stabilize roll
  • Limits — angular clamping to prevent unnatural rotations

When to use it: Head and eye aim at targets, weapon barrel aim at a target point, upper spine lean toward a point of interest. Chain multiple Multi-Aim constraints (head, neck, upper spine each with decreasing weights) for organic distributed aim motion. Set generous limits (45–60 degrees per bone) to prevent the "owl neck" look where a single bone rotates too far.

Chain IK Constraint

What it does: Solves a chain of more than two bones to reach a target, distributing the rotation across all bones in the chain. Unlike Two Bone IK which distributes rotation across exactly two bones, Chain IK works with any chain length.

When to use it: Tails, tentacles, spine chains, fingers (as a chain), animal necks, and any organic appendage with multiple joints that needs to reach toward a target or away from one. Chain IK produces the organic distributed bend characteristic of flexible limbs.

Key tip: Chain IK can also be used in "aim" mode to make a spine chain lean toward a target without fully solving to touch it — useful for subtle body lean toward an aim point without the full twist that a tight IK solve would create.

Override Transform Constraint

What it does: Overrides a bone's position, rotation, or scale with a target Transform's values, with a configurable weight and space (world, local, pivot).

When to use it: Attaching objects to bones (weapons to hand bones), pinning a bone's position to a world point (holding a door handle), or overriding the animation pose for a bone entirely. This is the "hard override" constraint — use it when you need a bone to exactly match a target rather than solve toward it.

Blend Constraint

What it does: Interpolates a bone's transform between two source Transforms based on a weight value.

When to use it: Transitioning between two targets smoothly — blending between a hand's animation pose and an IK target pose, or transitioning the head aim direction between two points of interest. Often used with a weight parameter driven by game state (entering/leaving an interaction zone).

Copy Transform Constraint

What it does: Copies the world transform (position, rotation, or both) of one Transform to another bone.

When to use it: Syncing bones between different rigs, copying a weapon's world transform to an off-hand grip bone, or making secondary objects follow primary bones with a weight blend. Simpler than Override Transform when you need direct copying without space conversion.

Foot IK Setup: Step by Step

Foot IK is the most universally needed procedural animation feature — without it, characters float or sink into sloped terrain. Here is the complete setup process:

  1. Create a Rig GameObject as a child of your character's root Animator GameObject. Add a Rig component to it.
  2. Add the Rig Builder component to the root Animator GameObject. Add your Rig to its Rig Layer list.
  3. Create foot target GameObjects — empty GameObjects, one per foot. These will be the IK target Transforms. Place them as children of the character root (not the rig).
  4. Add Two Bone IK constraints — one per foot, as children of the Rig GameObject. Assign the Root (upper leg), Mid (lower leg), and Tip (foot) bones from your character's skeleton. Assign the foot target as the Target Transform. Assign an empty hint GameObject positioned at the knee as the Hint.
  5. Create a foot IK script (MonoBehaviour) that runs in LateUpdate (after the Animator). Each frame: cast a ray downward from above each foot's animated position. If the ray hits terrain, set the foot target Transform's position to the hit point. Set the foot target's rotation to align with the surface normal. Blend the constraint's weight based on whether the foot is in swing or contact phase (use the animation's foot contact curve or velocity threshold).
  6. Add body height adjustment — calculate the average foot height offset from the terrain and smoothly move the character's body downward by that amount, so the character crouches proportionally on sloped terrain.

Key foot IK tuning parameters: raycast origin height (start 0.5–1m above the expected foot position), raycast length (extend below the lowest expected terrain depression), foot normal blend amount (how aggressively the foot tilts to match the surface), and body height lerp speed (slow for organic feel, faster for responsive feel).

Hand IK for Weapon Holding

Weapon holding with hand IK ensures that a character's hands remain on the weapon's grip points regardless of the underlying body animation. The setup:

  1. Add grip point GameObjects as children of your weapon's root GameObject — one for the primary grip (right hand), one for the secondary grip (left hand).
  2. Create Two Bone IK constraints for each arm, targeting the grip point Transforms.
  3. Drive the constraint weights based on the character's weapon state: weight 0 when unarmed, lerp to weight 1 when the character picks up or equips the weapon.
  4. For the off-hand specifically, add a hint bone positioned at the left elbow's natural direction to prevent the IK from solving the elbow backward.

Important: The primary hand (right for right-handed characters) should typically be parent-constrained to the weapon, not IK-solved. The weapon follows the right hand. The secondary grip IK then solves the left hand to reach the weapon's secondary grip point. This ordering prevents IK feedback loops.

Aim Constraint for Upper Body Aiming

Full upper-body aiming — where the character's spine rotates to aim a weapon up and down while the lower body plays independent locomotion animation — is a multi-step setup:

  1. Create an aim target GameObject placed in world space at the player's aim point (raycast from camera through crosshair).
  2. Add Multi-Aim constraints to the upper spine bones (typically Spine, Spine1, Chest) with decreasing weights as you go down the chain (Chest: 0.3, Spine1: 0.4, Spine: 0.3).
  3. Add a Multi-Aim constraint to the Head with a separate weight (typically 0.8–1.0) so the character looks at the aim point.
  4. Wrap all aim constraints in a dedicated Rig layer so you can blend the entire aim system's weight with a single parameter.
  5. Fade aim weight out during reloading, melee attacks, cover transitions, and any animation that overrides the upper body.

Multi-Layer Rig Setup

Complex characters benefit from organizing constraints into multiple distinct Rig layers:

  • Layer 1 — Foot IK: Two Bone IK for both feet. Always active during locomotion.
  • Layer 2 — Aim: Multi-Aim constraints for spine and head. Weighted in/out based on combat state.
  • Layer 3 — Hand IK: Two Bone IK for hands to weapon grips. Active only when armed.
  • Layer 4 — Interaction: Override Transform constraints for specific interactions (pulling a lever, opening a door). Active only during interaction animations.

Each layer runs in sequence after the Animator. Layer 1 runs first, its output becomes the input for Layer 2, and so on. This stacking means foot IK establishes the base pose, then aim adjusts the upper body, then hand IK further refines the arm positions.

Combining Motion Capture with Procedural Constraints

Motion capture animation provides the organic quality and physical authenticity that is difficult to achieve with keyframe animation. Procedural constraints adapt that captured performance to the runtime environment. The combination is greater than either approach alone:

  • Mocap gives you correct weight transfer, natural timing, and human-quality motion for locomotion and combat
  • Foot IK adapts the mocap's foot placement to any terrain the level designer creates
  • Aim IK lets mocap locomotion animations (captured on flat ground) work with full vertical aim range
  • Hand IK keeps weapon grip positions correct regardless of body rotation during mocap sequences

Import motion capture FBX files as animation clips, retarget them to your character's skeleton using Unity's humanoid retargeting system (or generic retargeting for custom skeletons), then add the Animation Rigging constraints on top. The constraints will adapt the mocap performance to your runtime conditions without requiring re-authoring of the underlying animation data.

Performance Considerations

Animation Rigging constraints run on the main thread by default and add CPU cost. Performance guidelines:

  • Constraint count matters — each active constraint has a cost. Disable constraints when they are not needed (set weight to 0 or disable the constraint component).
  • Use Burst compilation — Animation Rigging supports the Jobs system and Burst compiler when available. Enable Burst in your project for significant performance gains on constraint evaluation.
  • LOD weight scaling — reduce or disable constraint weights on distant characters using LOD Groups. Full foot IK on 50 NPCs in a crowd is expensive; fade it out beyond 20 meters.
  • Profile before optimizing — use the Unity Profiler's Animation track to measure constraint cost. Premature optimization is common in animation rigging discussions; measure first.

Common Setup Mistakes

  • Wrong constraint execution order — constraints within a Rig run in the order their GameObjects appear in the hierarchy. If Hand IK runs before Aim, the hand position won't account for the aim rotation. Order matters.
  • Missing hint bones — Two Bone IK without a hint bone often solves to an arbitrary elbow/knee direction. Always add hint GameObjects positioned in the natural joint direction.
  • IK targets not in the right parent space — foot IK targets must be in world space (or a space independent of the character root) to correctly represent terrain positions. Parenting targets to the character root defeats terrain adaptation.
  • Forgetting to weight down during overriding animations — a death animation that ragdolls the character while foot IK is still at full weight will fight the physics. Drive constraint weights from Animator parameters or animation events to zero before physics-driven animations play.
  • Using Animation Rigging without the Rig Builder — constraints do nothing without the Rig Builder component on the Animator root. This is the number one beginner setup error.

Integration with the Animator

The Animation Rigging package is designed to layer on top of the Animator's output, not replace it. The typical data flow:

  1. Animator evaluates and outputs a pose (from Animator Controller state machine, blend trees, and animation clips)
  2. Rig Builder executes all Rig Layers in order, each constraint modifying the pose
  3. Final modified pose is applied to the skeleton's Transform hierarchy

This means your Animation Controller logic (state machine, parameters, transitions) remains unchanged. Animation Rigging is entirely additive — it adapts the Animator's output without modifying the Animator itself.

Drive constraint weights from Animator parameters using a custom MonoBehaviour that reads Animator state and updates constraint weights accordingly. This keeps the animation logic centralized in the Animator while the rigging layer responds to it.

Frequently Asked Questions

Does Animation Rigging work with the Universal Render Pipeline?

Yes. The Animation Rigging package is render pipeline agnostic — it operates on skeleton transforms before rendering and works identically with Built-in, URP, and HDRP render pipelines.

Can I use Animation Rigging with non-humanoid characters?

Yes. Animation Rigging works with any skeleton — humanoid or generic. You reference bones directly by the bone GameObjects in your hierarchy rather than using Unity's humanoid avatar system. This makes it fully compatible with creature, vehicle, and mechanical rigs of any structure.

How do I blend foot IK off during jump and fall animations?

Drive the foot IK constraint weights to 0 when the character is in air. Use Animator parameters (IsGrounded) or physics checks (CharacterController.isGrounded) to detect air state and lerp the constraint weight from 1 to 0 at liftoff. Lerp back to 1 on landing, synchronized with the landing animation's foot plant frame.

Is Animation Rigging compatible with Cinemachine?

Yes. Cinemachine operates on the camera level after the Animator and Animation Rigging have resolved the character's pose. They are independent systems. Some studios also use Animation Rigging constraints on camera rigs for procedural camera motion, which works within the Cinemachine brain update loop.

What is the difference between Animation Rigging and the older Unity IK system (Animator.SetIKPosition)?

The legacy Animator IK system (SetIKPosition, SetIKRotation) only supports four IK goals (two hands, two feet) on humanoid characters and has limited configurability. Animation Rigging is a full constraint-based system that works on any skeleton, supports any number of constraints of various types, can be layered, blended, and organized into reusable rigs. For any new project, prefer Animation Rigging over the legacy IK API.

Add Professional Mocap Data to Your Unity Rig

Animation Rigging constraints are only as good as the base animation data they extend. Professional motion capture packs provide the locomotion, combat, and character animation foundation that procedural constraints then adapt to your runtime environment. Browse the full library of Unity-compatible motion capture animation packs at MoCap Online — Unity Motion Capture Animations. All packs include FBX files with humanoid rig compatibility and in-place animation variants optimized for Unity's Animation Controller and root motion systems.

Ready to get started with Unity animations?

View Unity MoCap Animation Catalog →