
unity-animation
Drive Unity 6.3 LTS 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.
- Installs
- 6.1K
- Last 24h
- +314
- Trending rank
- #928
- Security
- Pass
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill unity-animation- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads unity-animation automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
Unity Animation (Animator / Mecanim)
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).
When to use
- Use when connecting animation clips into a state machine, driving them from script via parameters, blending locomotion (idle→walk→run), layering an upper-body action over movement, or adding foot/hand IK on a humanoid rig.
- Use when the project has
*.controller(Animator Controller) and*.animassets, or a rigged 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.
Core workflow
- Add an
Animatorto 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). - Define parameters on the controller —
Float(Speed),Bool(IsGrounded),Int,Trigger(Jump) — and states with transitions whose conditions read those parameters. - Set parameters from script, never poke states directly:
SetFloat,SetBool,SetInteger,SetTrigger. The state machine resolves transitions for you. - Blend continuous motion with a Blend Tree (one
Floatlike Speed drives idle↔walk↔run) instead of many discrete states + transitions. - Layer additive/override motion (e.g. an upper-body "aim" layer with an Avatar Mask) and
control its
layerWeight. - Verify in the Animator window during Play mode — the live state highlights and parameter values update, so you can see exactly which transition fired (or didn't).
Patterns
1. Drive locomotion + a one-shot action from script
using 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
}
2. Smooth a noisy input into a blend parameter
// dampTime smooths Speed so the blend tree doesn't snap; great for analog sticks.
_anim.SetFloat(Speed, targetSpeed, 0.1f /* dampTime */, Time.deltaTime);
3. Play / cross-fade a state directly (bypassing parameter conditions)
// Useful for hit reactions where you want an immediate, explicit transition.
_anim.CrossFade("Hit", 0.1f); // 0.1 = 10% of the state's length, not seconds
_anim.CrossFadeInFixedTime("Hit", 0.15f); // duration in seconds
// Or jump instantly: _anim.Play("Hit");
4. Wait until the current state finishes
private System.Collections.IEnumerator AfterAttack()
{
yield return null; // let the Animator start the transition
// During a transition the "current" state is the one being left; read the next one.
var info = _anim.IsInTransition(0)
? _anim.GetNextAnimatorStateInfo(0)
: _anim.GetCurrentAnimatorStateInfo(0); // layer 0
yield return new WaitForSeconds(info.length); // seconds; approximate, varies in blend trees
// ...follow-up logic
}
Pitfalls
SetTriggermissed or "sticks" — triggers are consumed by the next satisfied transition and auto-reset; if no transition consumes it, it can fire later unexpectedly. UseResetTriggerto clear, or prefer aBoolwhen the condition is a sustained state.- String parameter typos fail silently — a misspelled name just does nothing. Use
Animator.StringToHashand cache the int hashes. - Transition feels laggy —
Has Exit Timemakes the transition wait for the clip to reach a normalized time. Uncheck it for responsive, condition-driven transitions (jump, hit). - Character slides or won't move —
Apply Root Motionis on but your code also moves the transform (or vice versa). Decide: root motion or scripted movement, not both. - Upper-body layer overrides the whole body — set the layer's Blend mode (Override vs
Additive), assign an Avatar Mask, and tune
layerWeight(0–1). - A cross-fade is much slower or faster than expected —
CrossFade's duration is normalized to the state's length. UseCrossFadeInFixedTimeto give the duration in seconds. - IK does nothing — IK only applies inside
OnAnimatorIK, requires "IK Pass" enabled on the layer, and needs a Humanoid Avatar.
References
- For blend trees (1D vs 2D Freeform/Directional), animation layers + Avatar Masks,
and humanoid IK (
OnAnimatorIK,SetIKPositionWeight,SetIKPosition, look-at), readreferences/blend-trees-and-ik.md. - Primary docs: Unity Manual "Animation" section and
ScriptReference/Animator.
Related skills
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.
FAQ
What does the unity-animation skill do?
Drive Unity 6.3 LTS 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.
How do I install unity-animation?
Run npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill unity-animation in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/unity-animation/ (personal) or .claude/skills/unity-animation/ (project).
Which AI agents can use unity-animation?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is unity-animation safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains unity-animation?
It is published by gamedev-skills in gamedev-skills/awesome-gamedev-agent-skills. It has 6,103 recorded installs.
More from gamedev-skills/awesome-gamedev-agent-skills
game-feel
gamedev-skills/awesome-gamedev-agent-skills
Add "juice" and game feel that makes actions satisfying — screen shake, hit-stop/freeze frames, tweened/eased motion, squash & stretch, knockback, and layered audio-visual feedback — as engine-neutral techniques that pair with the detected engine's tween, particle, and camera APIs. Use when the user mentions game feel, juice, "make it feel good/punchy", screen shake, hit stop, screen freeze, easing, squash and stretch, impact frames, or feedback/polish on hits, jumps, pickups, and deaths.
game-ui-ux
gamedev-skills/awesome-gamedev-agent-skills
Design and build game UI/UX — HUDs, menus, and overlays — that survive every screen: anchor- based responsive layout, resolution/aspect scaling and safe areas, keyboard/gamepad focus navigation, a screen/menu state stack, and event-driven (not polled) HUD updates. Engine- neutral patterns that pair with the detected engine's UI skill. Use when the user mentions HUD, health bar, main menu, pause menu, settings screen, UI layout, anchors, UI scaling, aspect ratio, safe area, controller/keyboard menu navigation, or wiring UI to game state.
level-design
gamedev-skills/awesome-gamedev-agent-skills
Design and build playable levels — the blockout/whitebox-to-playable workflow, player metrics and grid layout, pacing and flow (tension/rest curve), gating and the critical path, and encounter design. Engine-neutral practice. Use when the user mentions level design, blockout/whitebox/greybox, level layout, level pacing, encounter design, or the critical path through a level.
performance-optimization
gamedev-skills/awesome-gamedev-agent-skills
Find and fix game performance problems methodically — measure with the engine profiler first, reason about the frame-time budget, locate the CPU-vs-GPU bottleneck, then apply the right fix: object pooling, draw-call batching, fewer allocations/GC spikes, and asset budgets. Engine- neutral method that pairs with each engine's profiler. Use when the user mentions performance, optimize, low/dropping FPS, frame drops, stutter, lag, profiler, frame budget, draw calls, batching, garbage collection/GC spikes, object pooling, or "the game runs slow".
game-ai
gamedev-skills/awesome-gamedev-agent-skills
Design NPC and enemy decision-making with finite state machines, behavior trees, steering behaviors, and A pathfinding — engine-neutral algorithms that pair with the detected engine's navigation API. Use when building enemy AI, an FSM or behavior tree, steering/flocking, or pathfinding, or when the user mentions state machine, behavior tree, blackboard, A, navmesh, seek, or patrol/chase.
audio-design
gamedev-skills/awesome-gamedev-agent-skills
Implement game audio practice — bus/mixer architecture and gain in decibels, ducking (sidechain), adaptive/dynamic music via layering and re-sequencing, SFX variation, and beat synchronization. Engine-neutral. Use when the user mentions audio mixing, audio buses, adaptive/dynamic music, ducking, SFX variation, music layers, or syncing gameplay to the beat.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.