Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
A Godot plugin that manages state machines & state transitions.It features: - A StateMachine based on nodes - Nested StateMachines - Pushdown Automatas - Automatic animation triggering directly AnimatedSprite - A powerful GraphEditor to handle state transitions - State change based on signals and/or as many conditions you want
A Godot plugin that manages state machines & state transitions.
It features:
- A StateMachine based on nodes
- Nested StateMachines
- Pushdown Automatas
- Automatic animation triggering directly AnimatedSprite
- A powerful GraphEditor to handle state transitions
- State change based on signals and/or as many conditions you want
This addon is under MIT license which means its free to use/copy/modify etc. If you want to help financally its creator, you can tip him here
💾 Install 💾
You can either:
- Browse for StateGraph in the AssetLib tab inside Godot, and install it from there, using the Godot's plugin install interface.
- Clone this repo in a folder
addons/StateGraph
a the root of your project; then activate the plugin in ProjectSettings -> Plugins
📃 Documentation 📃
You can find a detailed, by class documentation, as well as a tutorial on how to use the GraphEditor here.
🕵️ Overview 🕵️
Basic use
StateGraph is an implementation of the State -also known as Finite State Machine- design pattern.
It uses basically two types of nodes: a StateMachine node that handles its State children, like in this exemple bellow.
You can inherit the State class to associate it with your own logic, or just use basic State nodes if you are doing a StateMachine dedicated to animation for exemple.
If you inherit the State class, be aware that your scripts must have the tool
keyword for it to work with the GraphEditor.
You can find more informations about how to use the State class and every others in the Documentation.
Graph Editor
The GraphEditor is a tool that runs inside the Godot's editor and allows you to manage & edit the connexions between states as well as standalone triggers.
Connexions can be triggered either by signals or in the _physics_process()
of the StateMachine.
Additionaly it can take any amount of conditions that must all return true for the change of state to operate.
The graph also implements standalone triggers that works exacly as connexions, but does not need to be in a particular state to trigger.
It is designed to be very flexible and to keep the graph as readable as possible, by minimising the number of connexions you need to make between two states. If it is correcly used, it will prevent you from writing any boilerplate state transition code. (You can still do it by code tho)
A Godot plugin that manages state machines & state transitions.
It features:
- A StateMachine based on nodes
- Nested StateMachines
- Pushdown Automatas
- Automatic animation triggering directly AnimatedSprite
- A powerful GraphEditor to handle state transitions
- State change based on signals and/or as many conditions you want
Reviews
Quick Information
A Godot plugin that manages state machines & state transitions.It features: - A StateMachine based on nodes - Nested StateMachines - Pushdown Automatas - Automatic animation triggering directly AnimatedSprite - A powerful GraphEditor to handle state transitions - State change based on signals and/or as many conditions you want