Unity State Machines

Unity state and behavior system architecture. FSM, Hierarchical FSM, Behavior Trees, stack-based state machines, Animator-vs-code decisions, state machine testing. DECISION format: WHEN/DECISION/SCAFFOLD/GOTCHA. Based on Unity 6.3 LTS.

40 stars 6 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add Nice-Wolf-Studio/unity-claude-skills --skill unity-state-machines
Manual install
git clone --depth 1 https://github.com/Nice-Wolf-Studio/unity-claude-skills.git /tmp/unity-claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/unity-claude-skills/skills/unity-state-machines ~/.claude/skills/unity-state-machines

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# State & Behavior Systems -- Decision Patterns

> **Prerequisite skills:** `unity-game-architecture` (MonoBehaviour vs plain C#, component composition), `unity-animation` (Animator FSM, StateMachineBehaviour), `unity-scripting` (MonoBehaviour lifecycle)

These patterns address the most common state management failure: Claude writes ad-hoc `if/else` chains or giant switch statements with no structure, making state logic unmaintainable beyond 3-4 states.

---

## PATTERN: State System Selection

WHEN: Implementing AI behavior, game flow, character states, or UI navigation

DECISION:
- **Animator FSM** -- States are tied to animations. Character locomotion, attack combos, death animations. Designer-friendly visual graph. See `unity-animation` for full coverage -- do not build a code FSM just to drive animations.
- **Code FSM (enum or class-based)** -- Game flow (MainMenu/Playing/Paused/GameOver), ability systems, turn phases. Fully testable, no Animator overhead. Use when states have complex logic, not just animation swaps.
- **Hierarchical FSM (HFSM)** -- States within states. Combat contains {Melee, Ranged, Blocking}. When flat FSM has too many transitions between related states.
- **Behavior Tree (BT)** -- Complex AI with prioritization, interruptible sequences, parallel behaviors. When FSM has >8-10 states and transition explosion makes the graph unreadable.
Read the full skill on GitHub

Details

Skill name
unity-state-machines
Path
skills/unity-state-machines/SKILL.md
License
MIT
Repo updated
15 September 2026

FAQ

What does the Unity State Machines skill do?

Unity state and behavior system architecture. FSM, Hierarchical FSM, Behavior Trees, stack-based state machines, Animator-vs-code decisions, state machine testing. DECISION format: WHEN/DECISION/SCAFFOLD/GOTCHA. Based on Unity 6.3 LTS.

How do I install the Unity State Machines skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add Nice-Wolf-Studio/unity-claude-skills --skill unity-state-machines. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Unity State Machines popular?

It lives in Nice-Wolf-Studio/unity-claude-skills, which has 40 GitHub stars and 6 forks.

Related skills

Unity 2d

40

Nice-Wolf-Studio/unity-claude-skills

Unity 6 2D game development guide. Use when building 2D games, working with sprites, sprite atlas, SpriteRenderer, tilemaps, 2D physics (Rigidbody2D, Collider2D), 2D lighting, sorting layers, or sorting groups. Based on Unity 6.3 LTS documentation.

Research & Science

Unity 3d Math

40

Nice-Wolf-Studio/unity-claude-skills

Unity 3D math correctness patterns. Catches common mistakes with coordinate spaces, Quaternion, Vector3, Plane, Bounds, Transform hierarchies, raycasting projection, and floating-point precision. PATTERN format: WHEN/WRONG/RIGHT/GOTCHA. Based on Unity 6.3 LTS documentation.

Images, Video & Audio

Unity AI Navigation

40

Nice-Wolf-Studio/unity-claude-skills

Unity 6 AI and navigation guide. Use when working with NavMesh, pathfinding, NavMeshAgent, NavMeshSurface, NavMeshObstacle, off-mesh links, or Unity Sentis (ML model inference). Covers AI navigation package, runtime NavMesh baking, and common AI patterns like state machines and behavior trees. Based on Unity 6.3 LTS documentation.

AI, LLMs & Agents

Backend Patterns

32

joneqian/claude-skills-suite

Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, NestJS, FastAPI, and Next.js API routes.

Software Development

Unity Save System

40

Nice-Wolf-Studio/unity-claude-skills

Unity save/load system architecture. Serialization format selection, save data DTOs, versioning and migration, cloud sync, PlayerPrefs scoping, auto-save strategies, mobile persistence. DECISION format: WHEN/DECISION/SCAFFOLD/GOTCHA. Based on Unity 6.3 LTS.

Software Development

Codex

37

iamneilroberts/claude-skills

Delegate a task or question to the OpenAI Codex CLI running as an isolated subagent, then relay its answer. Use when the user invokes /codex <prompt>, says "ask codex", "have codex look at / do X", or wants a second independent model to investigate a question or make a self-contained edit. Read-only by default; /codex --write lets Codex edit the working tree. Distinct from /codex-review, which is the structured JSON review gate — /codex is a general-purpose Codex delegate.

Software Development

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.