Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

State Machine Bot

An asset by RetroDan007
The page banner background of a mountain and forest
State Machine Bot hero image

Quick Information

0 ratings
State Machine Bot icon image
RetroDan007
State Machine Bot

It is a state machine that you can implement in your project. Whether for a 2D or 3D game.

Supported Engine Version
4.4
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
6 hours ago
Git URL
Issue URL

In Godot, a Finite State Machine (FSM) is a design pattern used to manage the behavior of characters or entities by dividing their logic into discrete states (such as "Idle", "Run", "Jump") and transitions between them. This avoids the use of large blocks of nested conditional code, making the code more modular, scalable, and easy to maintain. How to use:

  1. Create an empty node within your scene that you want your state machine
  2. Add an empty node as a child of the node you just created and give it a state name you like
  3. Search the following route: addons\state_machine_bot\StateMachine
  4. With left click drag state.gd to your state.
  5. With left click drag state_machine.gd to you state machine node
  6. Select the node that contains your state. For example: "Idle"
  7. With right click you click extend_node and create the code for your custom state. That's all

Switch between states, call the state_machine variable then its function change_state_to(new_state:String) Example: we are in Idle and in the enter function: state_machine.change_state_to("Walk")

It is a state machine that you can implement in your project. Whether for a 2D or 3D game.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
State Machine Bot icon image
RetroDan007
State Machine Bot

It is a state machine that you can implement in your project. Whether for a 2D or 3D game.

Supported Engine Version
4.4
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
6 hours ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers