Posted July 08, 2025 by Shabby Games
A ready-to-use, modular finite state machine (FSM) template for 2D Godot projects. This example features two states: Idle and Walk.
This blueprint is designed for rapid setup: simply follow the structure shown here, and you wonβt need to modify any FSM code.
Just add your own nodes, animations, collision shapes, and set the default state in the Inspector.
Perfect for player, enemy, or NPC logic in any 2D game.
This is the base class for all states. It defines the interface that all state scripts should implement.
Manages transitions between different states (such as Idle, Walk, etc.) for any character or game object.
Each state is implemented as a child node (extending StateNode
), and the manager automatically handles entering and exiting states, as well as calling transition logic each frame.
Handles sprite animation and direction for the character.
Handles player movement, input, and updates the sprite controller.