ai-behavior-trees-util…
Engine-neutral behavior tree and utility AI code for NPCs in any language: Blackboard, reactive composites, decorators and…
Unity 6.3 LTS character animation with the Animator (Mecanim): states and transitions, blend trees, Avatar Mask layers, root motion and humanoid IK. Use for SetTrigger wiring, a transition that lags or never fires, sliding root motion, or an upper-body layer overriding the legs.
Claude Code
$ npx -y skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-animation --agent claude-code
Codex
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-animation -a codex -y
Cursor
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-animation -a cursor -y
Gemini CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-animation -a gemini-cli -y
GitHub Copilot
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-animation -a github-copilot -y
OpenCode
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-animation -a opencode -y
Windsurf
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-animation -a windsurf -y
name: unity-animation description: > Unity 6.3 LTS character animation with the Animator (Mecanim): states and transitions, blend trees, Avatar Mask layers, root motion and humanoid IK. Use for SetTrigger wiring, a transition that lags or never fires, sliding root motion, or an upper-body layer overriding the legs. Not for AI state machines (`game-ai`), juice (`game-feel`) or Godot (`godot-animation`).
Control animation state with the `Animator` and Animator Controllers in Unity 6.3 LTS (6000.3): parameters, transitions, blend trees, layers and humanoid IK. A `.controller` file is text YAML, so you can read its parameters and states without the Editor, and build one from editor code instead of the Animator window.
(idle, walk, run), layering an upper-body action over movement, foot or hand IK.
**When not to use:** simple value tweens (UI fades, position lerps) → a coroutine in `unity-csharp-scripting`; when an NPC should attack or flee → `game-ai`; Timeline cutscenes have no skill here. 2D sprite frame animation uses the same Animator with sprite keyframes.
1. **Read the controller before writing code.** In the `.controller` YAML, `m_AnimatorParameters` lists each parameter's `m_Name` and `m_Type` (1 Float, 3 Int, 4 Bool, 9 Trigger), and each `AnimatorState` document has its `m_Name`. Your script's strings must match these exactly. 2. **Set the rig.** Humanoid IK and retargeting need the model imported as Humanoid (`animationType: 3` in the model's `.meta`); ask before changing a model's rig, since it rebuilds the Avatar. 3. **Drive locomotion with parameters** (`SetFloat`, `SetBool`, `SetInteger`, `SetTrigger`) through cached `Animator.StringToHash` ids, and let transitions resolve. Use `CrossFadeInFixedTime` only for deliberate scripted cuts such as hit reactions. 4. **Blend continuous motion with a blend tree** driven by one `Float` (or two for 2D directional) instead of many states and transitions. 5. **Layer upper-body actions** with an Avatar Mask and `SetLayerWeight`. 6. **Create or change controllers from code** when the Editor UI is not available (pattern 3), then re-read the YAML to confirm. 7. **Verify** with the checks below.
using UnityEngine;
[RequireComponent(typeof(Animator))]
public class CharacterAnim : MonoBehaviour
{
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 Animator _anim;
private void Awake() => _anim = GetComponent<Animator>();
public void Tick(float planarSpeed, bool grounded)
{
_anim.SetFloat(Speed, planarSpeed, 0.1f, Time.deltaTime); // damped: no snapping
_anim.SetBool(IsGrounded, grounded);
}
public void DoJump() => _anim.SetTrigger(Jump); // consumed by the next matching transition
}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.
AnimatorStateInfo info = _anim.IsInTransition(0)
? _anim.GetNextAnimatorStateInfo(0)
: _anim.GetCurrentAnimatorStateInfo(0);
yield return new WaitForSeconds(info.length); // approximate inside blend trees
}Put this in an `Editor` folder. Run it from a menu item, from the Unity CLI with `unity command script eval --code 'BuildLocomotionController.Build();'`, or in batch mode with `-executeMethod BuildLocomotionController.Build`.
using UnityEditor;
using UnityEditor.Animations;
using UnityEngine;
public static class BuildLocomotionController
{
[MenuItem("Tools/Build Locomotion Controller")]
public static void Build()
{
if (!AssetDatabase.IsValidFolder("Assets/Animation"))
AssetDatabase.CreateFolder("Assets", "Animation");
var controller = AnimatorController.CreateAnimatorControllerAtPath("Assets/Animation/Player.controller");
controller.AddParameter("Speed", AnimatorControllerParameterType.Float);
controller.AddParameter("Jump", AnimatorControllerParameterType.Trigger);
AnimatorStateMachine sm = controller.layers[0].stateMachine;
AnimatorState locomotion = sm.AddState("Locomotion"); // assign a clip or blend tree as its motion
AnimatorState jump = sm.AddState("Jump");
sm.defaultState = locomotion;
AnimatorStateTransition toJump = locomotion.AddTransition(jump);
toJump.hasExitTime = false; // react to the trigger at once
toJump.duration = 0.1f;
toJump.AddCondition(AnimatorConditionMode.If, 0f, "Jump");
AnimatorStateTransition back = jump.AddTransition(locomotion);
back.hasExitTime = true; // return when the jump clip nearly ends
back.exitTime = 0.9f;
AssetDatabase.SaveAssets();
}
}names, and compare them with every string or `StringToHash` argument in the scripts. A typo does nothing at runtime, so this catches the most common bug for free.
controller's full structure (find its flags with `--help`). In Play mode, read live state: `unity command script eval --code 'var a = GameObject.Find("Player").GetComponent<Animator>(); return a.GetCurrentAnimatorStateInfo(0).IsName("L
<img src="docs/assets/awesome-gamedev-agent-skills-banner.png" width="820" alt="awesome-gamedev-agent-skills — game-dev skills for AI coding agents.
Engine-neutral behavior tree and utility AI code for NPCs in any language: Blackboard, reactive composites, decorators and…
Engine-neutral game audio technique: bus layout, volume sliders in decibels, loudness, ducking music under dialogue, adaptive…
Builds and tunes game cameras, engine-neutral with Godot and Cinemachine 3 mappings: 2D follow with deadzone and look-ahead,…
Plans, generates or sources, and validates consistent game art: style guides, sprites, pixel art, tilesets, icons and textures,…
Builds engine-neutral branching dialogue with Ink, Yarn Spinner or a small JSON graph runner: lines, choices, conditions,…
Designs engine-neutral enemy and NPC AI: picks FSM, behavior tree, utility or GOAP, and builds perception, steering and A*…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.