Gostate is a lightweight Godot plugin that provides a simple node-based hierarchical state machine system.
- Easy to get started - drop a GoStateMachine into your scene, add a couple of State nodes and pick an initial state. No boilerplate required.
- Organize behaviour visually - group related states and nested machines in the scene tree so your game logic reads like a map.
- Predictable lifecycle - GoState nodes emit signals when they become active or inactive so you can hook up animations, sounds, or setup/teardown code without guessing timing. They also expose most of the basic Godot overridable nodes such as _state_physics_process, _state_input, etc...
- Event-driven transitions - wire transitions with trigger_state_event(...) from code for quick, readable flow control.
- Lightweight and non-intrusive - small scripts, no external dependencies, and editor-friendly warnings so you spend less time debugging setup.
- Add a
GoStateMachinenode to your scene. - Add two child
GoStatenodes as children of theGoStateMachineand set theinitial_stateproperty in the state machine to one of them. - Add child
GoStateTransitionnodes under each state. - Trigger transitions by calling
trigger_state_event(&"your_event")on the state machine or state nodes.
This plugin is open-source and licensed under MIT License. Feel free to use, modify, and distribute it as needed.
📢 Feedback is welcome! 🚀
