
Object State Machine 1.0.0 Scripts 4.0 Community
Submitted by user lowlevel.1989; MIT; 2025-06-29
Full documentation available in the repository:
https://github.com/lowlevel-1989/object_state_machine
A hybrid state machine solution for Godot
- Single node in scene tree - Add just one NodeStateMachine node to your scene
- No node-based states - States are pure GDScript objects (not scene nodes)
- Optimized performance - Avoids scene tree overhead for state transitions
- Clean architecture - Keep your scene tree simple while managing complex behaviors
How It Works
- Add a single node to your scene (NodeStateMachine)
- Define states as scripts (extending StateAbstract)
- Manage transitions through lightweight objects
- Keep your scene tree clean - no nested state nodes
Where to Use This? (Great for Complex Behaviors!)
- Player behaviors: Idle, Run, Jump, Attack, Crouch
- Enemy AI: Patrol, Chase, Attack, Flee
- UI Systems: Main menu, Pause screen, Inventory
- Game Flow: Level loading, Cutscenes, Dialogue
- Complex object states: Treasure chest (locked, unlocking, open, empty), Security system (armed, disarmed, triggered)
- Building mechanics: Placement, Rotation, Connection, Demolition modes
Includes examples, documentation, and a clean architecture for handling transitions and input in pure script-based states.
View files Download Submit an issue Recent Edits