Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Drive Unity 6 character animation with Animator Controllers: states, transitions, parameters, blend trees, animation layers, and humanoid Avatar IK. Use when wiring an Animator, setting parameters from script (SetFloat/SetBool/SetTrigger), building blend trees, or when the user mentions Animator, Mecanim, state machine, blend tree, or .controller.
.claude/skills/gamedev-skills-unity-animation/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-07 | ✓→✗ | ▼ Worse | 26% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 22% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 119% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 59% | 0% |
Control animation state with Unity 6.3 LTS's Animator and Animator Controllers: parameters, transitions, blend trees, layers, and humanoid IK. Targets Unity 6.3 LTS (6000.3).
parameters, blending locomotion (idle→walk→run), layering an upper-body action over movement, or adding foot/hand IK on a humanoid rig.
*.controller (Animator Controller) and *.anim assets, or arigged model with an Avatar.
When not to use: simple non-skeletal value tweens (UI fades, position lerps) are better done with a tween/coroutine — see unity-csharp-scripting. Timeline cutscenes are a separate tool. 2D sprite frame animation also uses the Animator but with sprite keyframes.
Animator to the model and assign an Animator Controller; for a humanoid model,set its rig to Humanoid so it has an Avatar (enables retargeting and IK).
Float (Speed), Bool (IsGrounded), Int,Trigger (Jump) — and states with transitions whose conditions read those parameters.
SetFloat, SetBool,SetInteger, SetTrigger. The state machine resolves transitions for you.
Float like Speed drives idle↔walk↔run)instead of many discrete states + transitions.
control its layerWeight.
values update, so you can see exactly which transition fired (or didn't).
csharpusing UnityEngine; [RequireComponent(typeof(Animator))] public class CharacterAnim : MonoBehaviour { private Animator _anim; // Cache parameter hashes — faster and typo-proof vs string lookups every frame. private static readonly int Speed = Animator.StringToHash("Speed"); private static readonly int IsGrounded= Animator.StringToHash("IsGrounded"); private static readonly int Jump = Animator.StringToHash("Jump"); private void Awake() => _anim = GetComponent<Animator>(); public void Tick(float planarSpeed, bool grounded) { _anim.SetFloat(Speed, planarSpeed); // drives a 1D blend tree (idle/walk/run) _anim.SetBool(IsGrounded, grounded); // gates a falling/landing transition } public void DoJump() => _anim.SetTrigger(Jump); // fire-and-forget; auto-resets after use }
csharp// dampTime smooths Speed so the blend tree doesn't snap; great for analog sticks. _anim.SetFloat(Speed, targetSpeed, 0.1f /* dampTime */, Time.deltaTime);
csharp// Useful for hit reactions where you want an immediate, explicit transition. _anim.CrossFade("Hit", 0.1f); // blend over 0.1s normalized // Or jump instantly: _anim.Play("Hit");
csharpprivate System.Collections.IEnumerator AfterAttack() { var info = _anim.GetCurrentAnimatorStateInfo(0); // layer 0 yield return new WaitForSeconds(info.length); // approximate clip length // ...follow-up logic }
SetTrigger missed or "sticks" — triggers are consumed by the next satisfied transitionand auto-reset; if no transition consumes it, it can fire later unexpectedly. Use ResetTrigger to clear, or prefer a Bool when the condition is a sustained state.
Animator.StringToHash and cache the int hashes.
Has Exit Time makes the transition wait for the clip to reacha normalized time. Uncheck it for responsive, condition-driven transitions (jump, hit).
Apply Root Motion is on but your code also moves thetransform (or vice versa). Decide: root motion or scripted movement, not both.
Additive), assign an Avatar Mask, and tune layerWeight (0–1).
OnAnimatorIK, requires "IK Pass" enabled onthe layer, and needs a Humanoid Avatar.
and humanoid IK (OnAnimatorIK, SetIKPositionWeight, SetIKPosition, look-at), read references/blend-trees-and-ik.md.
ScriptReference/Animator.unity-csharp-scripting — the MonoBehaviour and coroutine timing used above.unity-physics — moving the body that the animation visualises.game-ai — deciding when to play which animation state.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,454 | 9,486 | -29% | 1 | 1 | 0% | 2,479 | 3,151 | +27% | 0 | 0 | — |
case-02 | fail→fail | 11,773 | 9,110 | -23% | 1 | 1 | 0% | 2,035 | 2,990 | +47% | 0 | 0 | — |
case-03 | pass→pass | 9,256 | 3,511 | -62% | 1 | 1 | 0% | 1,638 | 1,998 | +22% | 0 | 0 | — |
case-04 | pass→pass | 6,438 | 6,648 | +3% | 1 | 1 | 0% | 1,098 | 2,407 | +119% | 0 | 0 | — |
case-05 | pass→pass | 8,427 | 5,372 | -36% | 1 | 1 | 0% | 1,378 | 2,191 | +59% | 0 | 0 | — |
case-06 | pass→pass | 8,337 | 6,488 | -22% | 1 | 1 | 0% | 1,514 | 2,548 | +68% | 0 | 0 | — |
case-07 | pass→fail | 13,986 | 10,385 | -26% | 1 | 1 | 0% | 2,678 | 3,373 | +26% | 0 | 0 | — |
case-08 | pass→pass | 5,801 | 4,673 | -19% | 1 | 1 | 0% | 968 | 2,313 | +139% | 0 | 0 | — |
case-09 | pass→pass | 3,955 | 3,267 | -17% | 1 | 1 | 0% | 638 | 1,957 | +207% | 0 | 0 | — |
case-10 | pass→pass | 3,236 | 2,679 | -17% | 1 | 1 | 0% | 514 | 1,751 | +241% | 0 | 0 | — |
case-11 | pass→pass | 10,789 | 7,744 | -28% | 1 | 1 | 0% | 2,128 | 2,876 | +35% | 0 | 0 | — |
case-12 | pass→pass | 7,615 | 7,811 | +3% | 1 | 1 | 0% | 1,155 | 2,674 | +132% | 0 | 0 | — |
case-13 | pass→pass | 11,516 | 12,672 | +10% | 1 | 1 | 0% | 2,274 | 3,637 | +60% | 0 | 0 | — |
case-14 | pass→pass | 5,946 | 3,129 | -47% | 1 | 1 | 0% | 1,160 | 1,951 | +68% | 0 | 0 | — |
case-15 | pass→pass | 2,761 | 2,679 | -3% | 1 | 1 | 0% | 406 | 1,795 | +342% | 0 | 0 | — |
case-16 | fail→fail | 9,127 | 11,820 | +30% | 1 | 1 | 0% | 1,565 | 2,949 | +88% | 0 | 0 | — |
case-17 | pass→pass | 9,954 | 6,354 | -36% | 1 | 1 | 0% | 1,864 | 2,504 | +34% | 0 | 0 | — |
case-18 | pass→pass | 4,413 | 4,654 | +5% | 1 | 1 | 0% | 757 | 2,085 | +175% | 0 | 0 | — |
case-19 | pass→pass | 11,382 | 7,612 | -33% | 1 | 1 | 0% | 1,952 | 2,700 | +38% | 0 | 0 | — |
case-20 | pass→pass | 10,107 | 9,472 | -6% | 1 | 1 | 0% | 1,721 | 2,817 | +64% | 0 | 0 | — |
case-21 | pass→pass | 11,464 | 12,461 | +9% | 1 | 1 | 0% | 2,026 | 3,708 | +83% | 0 | 0 | — |
case-22 | pass→pass | 4,707 | 5,615 | +19% | 1 | 1 | 0% | 951 | 2,473 | +160% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of 0 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/2/2026 | +5% |
Other measured skills in the registry, with their headline benchmark lift.