arnemileswinter / FiniteStateMachine

A Plugin with an FSM Node that contains a State and a Transition as children nodes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FiniteStateMachine

A Plugin with an FSM and its components State and Transition as Nodes.

Getting Started

Requirement

  • Godot Engine v3.2+

Installation

After downloading, move the folder "addons/fsm-node" to your project folder.

For additional script templates, move folder "script_templates" to your project folder as well.

Usage

After adding FSM, add States and Transitions as its children Nodes.

  • A State can run its logic by calling _process(delta), _physics_process(delta) and/or _input(event)
  • Other Nodes can connect their signals to a Tranistion using a method, _condition(). This is to prompt the FPS to change State.

Upon running the project, all States deactivate their process functions, and all Transitions disconnect their incoming signals. The FSM will keep one State activated and re-connect the incoming signals of the Transitions connected to the State.

Author

  • mechPenSketch

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Contributions

In addition to sponsors, you can support me by buying these merch:

Acknowledgements

  • GDQuest and PigDev's youtube videos for helping me understand the concept of FSM better.
  • Using FSM by kubecz3k also helps me understand the concept better.

About

A Plugin with an FSM Node that contains a State and a Transition as children nodes.

License:MIT License


Languages

Language:GDScript 100.0%