Skip to content

Instantly share code, notes, and snippets.

View alkemann's full-sized avatar

Alexander Morland alkemann

View GitHub Profile
## A state machine that manages state transitions and executes callbacks.
class_name StateMachine
## The currently active state.
var current_state: State
## Sets the initial state and calls its enter callback.
## Should be called once during initialization (e.g., in _ready()).
func set_initial_state(state: State):
_set_state(state)