lowlevel.1989
Object State Machine
Full documentation available in the repository:https://github.com/lowlevel-1989/object_state_machineA 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 behaviorsHow 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 nodesWhere 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 modesIncludes examples, documentation, and a clean architecture for handling transitions and input in pure script-based states.