unity-fsm

Installation
SKILL.md

Unity Finite State Machine (FSM)

This skill provides a modular, object-oriented State Machine architecture for Unity, specifically refactored to match the implementation in Adam Myhre's 3D Platformer.

Core Features

  • Object-Oriented: Each state is a dedicated class.
  • Hybrid Support: Support for both "Heavy" (classes) and "Light" (ActionState) states.
  • Strategy-Based Transitions: Uses Predicates and Detection Strategies.
  • Timer System: Includes Adam Myhre's CountdownTimer and StopwatchTimer.
  • Namespace Support: Uses Platformer and Utilities namespaces.

Core Files (assets/code/)

  • IState.cs.txt, StateMachine.cs.txt, IPredicate.cs.txt: Base FSM logic.
  • ActionState.cs.txt: New! Lambda-based state to reduce boilerplate.
  • Timer.cs.txt: AI cooldown management.
  • IDetectionStrategy.cs.txt, ConeDetectionStrategy.cs.txt: Sensing logic.
  • PlayerDetector.cs.txt, Enemy.cs.txt, EnemyBaseState.cs.txt: AI templates.

Usage Guides

Related skills
Installs
12
GitHub Stars
7
First Seen
Apr 18, 2026