# Animation (Animator / Mecanim, Blend Trees, Animation Rigging / IK)
> **Target:** Unity **6000.5+**. Built-in Mecanim (Animator, Avatar, Animator Controller, Blend Trees). Optional package: **Animation Rigging** (`com.unity.animation.rigging`) from Package Manager — cite the Unity 6 package docs (manual/API pages under `
[email protected]` were used to verify constraint and RigBuilder APIs). Check Package Manager for the version that resolves for *your* Editor; do not invent pin numbers.
> [!warning] Verification status
> **None of the C# in this set was compiled in a Unity Editor.** Verified against Unity Manual **6000.5** (Animator Controller, parameters, transitions, blend trees, Avatar Mask, root motion, animation events, `OnAnimatorIK`) and Animation Rigging package docs **6.6.0** (`RigBuilder`, `Rig`, `TwoBoneIKConstraint` / `TwoBoneIKConstraintData`, `MultiAimConstraint`, constraint list). Items marked *(unverified)* or listed in each part's "Unverified" section were written from known patterns and should be checked in your Editor before shipping.
This is the **fundamentals + Animation Rigging / IK intro**. Deeper layers/masks, complex root-motion edge cases, and advanced override stacks are covered in [[Animation Advanced]]. Keep gameplay state machines in code ([[Enemy AI State Machine]], [[Architecture and Code Patterns]]); drive the Animator from that brain.
**Design lens:** character readability and the Three Cs (Character, Camera, Control) from [[Level Up! (Review)]] (Level 5 Character). Locomotion and look-at IK are how the Character *sells* intent to the player.
Related: [[Timeline Basics]] (Animation tracks, Avatar Mask overrides) · [[Enemy AI State Machine]] (brain drives Animator) · [[Architecture and Code Patterns]] / [[Game Programming Patterns (Review)]] (State) · [[Organic Enemy Sensing]] (targets for look-at / aim) · [[Car Controller]] / [[Surface-Walking with an Omnidirectional Player Movement]] (movement that must sync with or ignore root motion) · [[Meta Quest 2]] (animation cost on mobile VR).
## Reading order
1. **[[1.Clips Avatar and Animator]]** — Animation Clips, Humanoid vs Generic Avatar, Animator component, Controller asset.
2. **[[2.States Transitions and Parameters]]** — states, transitions, parameters, Any State, Sub-State Machines.
3. **[[3.Blend Trees]]** — 1D and 2D blend trees for locomotion.
4. **[[4.Layers Masks Root Motion and Events]]** — layers + Avatar Masks (preview), root motion vs in-place, Animation Events.
5. **[[5.Animation Rigging and Script IK]]** — RigBuilder workflow, TwoBoneIK, MultiAim, vs `OnAnimatorIK`.
6. **[[6.Worked Example Locomotion Look-At and Hand IK]]** — locomotion blend tree + look-at / hand IK on a simple humanoid.
7. **[[7.Animation Pitfalls]]** — Write Defaults, interruptions, retargeting, common foot-slide traps.
## Setup checklist (do once)
1. Unity **6000.5+** project with a humanoid character (FBX with Humanoid Avatar, or a sample).
2. Import clips as **Humanoid** (or Generic if you stay on one skeleton). Configure Root Transform Bake Into Pose as needed (part 4).
3. Create `Assets/_Project/Animation/` with `Controllers`, `Masks`, `Clips`, `Rigs`, `Scripts`.
4. For parts 5–6: Package Manager → Unity Registry → **Animation Rigging**. Add `using UnityEngine.Animations.Rigging;`.
5. Optional Input System package if you prefer it over legacy axes in the worked example (both shown).
## Package / docs cited
| Topic | Source |
|---|---|
| Animator Controller, state machines | Unity Manual 6000.5 — Animator Controller / Animation State Machine |
| Parameters | Manual — Animation Parameters (`SetFloat`, `SetBool`, `SetTrigger`, …) |
| Transitions / interruption | Manual — Animation transitions |
| 1D Blend Trees | Manual — 1D Blending |
| Avatar Mask | Manual — Avatar Mask window |
| Root motion | Manual — How Root Motion works |
| Animation events | Manual — Add events to animation clips |
| `OnAnimatorIK` | Scripting API 6000.5 — `MonoBehaviour.OnAnimatorIK` |
| RigBuilder / Rig / constraints | Animation Rigging package manual & API **6.6.0** |
## Verified vs unverified (hub summary)
**Verified (docs):** `Animator.SetFloat` / `SetBool` / `SetInteger` / `SetTrigger` / `ResetTrigger`; transition Exit Time / Fixed Duration / Interruption Source; 1D blend thresholds / Automate Thresholds / Compute Thresholds; Avatar Mask humanoid body regions; Root Transform Bake Into Pose + `Animator.gravityWeight` behavior as documented; Animation Event function + Float/Int/String/Object; `OnAnimatorIK` requirements (Humanoid + IK Pass + script on same GO); `SetIKPosition` / `SetIKPositionWeight` / `SetIKRotation` / `SetIKRotationWeight` / `SetLookAtWeight` / `SetLookAtPosition` / `AvatarIKGoal`; `RigBuilder.Build`, `Evaluate`, `SyncLayers`, `layers`, `graph`; `Rig.weight`; `TwoBoneIKConstraint.weight` + `data.root|mid|tip|target|hint|targetPositionWeight|targetRotationWeight|hintWeight|maintainTargetPositionOffset|maintainTargetRotationOffset`; MultiAimConstraint inspector properties; constraint component list.
**Unverified (not compiled; check in Editor):** exact Input System wiring in the worked example; `Animator.MatchTarget` / `Animator.CrossFadeInFixedTime` usage details if you extend the example; MultiAimConstraint **C# data field names** (inspector props verified; scripted `data.*` access pattern assumed same as TwoBoneIK); whether your resolved Animation Rigging package minor differs from the 6.6.0 doc set while keeping the same type names; any Timeline override-track specifics beyond the cross-link to [[Timeline Basics]].
## See also
- Deeper follow-on: [[Animation Advanced]] (layer stacks, sync/Write Defaults, MatchTarget/CrossFade/Rebind, OverrideController, combat SSMs, reliable events).