unity-fsm

Organize Unity game AI behavior with modular state machines.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/MuharremTozan/Ohm-Yura --skill unity-fsm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-fsm
Source: https://github.com/MuharremTozan/Ohm-Yura/tree/main/.agents/skills/unity-fsm
Command: npx skills add https://github.com/MuharremTozan/Ohm-Yura --skill unity-fsm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) and references (resource) components.

What problem does it solve?

This skill provides a modular, object-oriented finite state machine architecture for Unity to manage complex AI behavior and state transitions with reusable states and clean wiring.

Core Features & Use Cases

  • Object-Oriented: Each state is implemented as its own class.
  • Hybrid States: Support for both full classes and lightweight ActionState-based states.
  • Strategy-Based Transitions: Transitions driven by predicates and detection strategies.
  • Timer Utilities: Includes CountdownTimer and StopwatchTimer for cooldowns and timing.
  • Practical Scenarios: Ideal for enemy AI, player controllers, and any system requiring structured state management.

Quick Start

Create a StateMachine, define your states (inherit from BaseState or use ActionState), wire transitions with predicates, and call Update in your game loop.

Frequently Asked Questions about unity-fsm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Unity AI behavior using a finite state machine?

To structure Unity AI behavior, use a modular finite state machine architecture where each state is its own class inheriting from BaseState, allowing clean wiring of transitions and reusable logic across multiple game objects.

What is the best way to manage state transitions in Unity enemy AI?

The best way to manage state transitions in Unity enemy AI is using strategy-based transitions driven by predicates and detection strategies, keeping transition logic decoupled from state implementation.

Can I use lightweight states instead of full classes for my Unity game AI?

You can use lightweight states by utilizing ActionState-based states, which provide a hybrid approach supporting both full classes and simpler action-driven states within your state machine.

How do I implement cooldowns and timing for player controllers in Unity?

To implement cooldowns and timing for player controllers, use the included CountdownTimer and StopwatchTimer utilities to manage time-based logic and state durations within your state machine architecture.

Does this Unity FSM approach require external libraries or dependencies?

This Unity FSM approach requires no external libraries or dependencies, providing core interfaces and classes like IState, StateMachine, and ITransition directly within your Unity project.

When should I use an object-oriented state machine for Unity game development?

You should use an object-oriented state machine for Unity game development when you need structured, extensible state management for complex AI behavior, requiring reusable states and clean wiring across multiple game objects.