andrew-wilkes / godot-state-machine

Godot State Machine using GDScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Godot State Machine

Godot 4 State Machine using GDScript

This code is associated with this tutorial: Godot State Machine

The updated version works by only having the current state node as a child of the Statemachine node. It allows for a very simple code structure.

The other states are in a floating state with no parent, so they don't receive calls to the game loop functions such as _process and _input.

The state nodes are identified by their name and must implement an enter() and exit(next_node_name) function.

About

Godot State Machine using GDScript

License:MIT License


Languages

Language:GDScript 100.0%