{"repo":"AlecSouthward/state-machine","free":true,"listed":false,"github":"https://github.com/AlecSouthward/state-machine","clone":"git clone https://github.com/AlecSouthward/state-machine.git","description":"State Machine for managing different States that an entity can be in.","language":"GDScript","stars":35,"topics":["godot","godot-engine","godot-tool","gdsc","gdscript","godot-4","godot-addon","godot-module","godot-plugin","godot4"],"license":"MIT","category":"game-templates","readme_excerpt":"Finite State Machine Creating State Machine To create the State Machine, simply create a new State Machine Node. [!NOTE] To make a starting State for the State Machine, select the State Machine and change the Initial State property. Creating a State To create a new State, create a script similiar to this... [!WARNING] If you do not specify a class name for your state, you will be unable to create a node of the State. To add the State to the State Machine, create a new Node of the State you just made, and add it as a child of the State Machine. Transitioning to other States To transition to other States on the State Machine, make sure there are more than one State as a child of the State Machine. To transition to another State, you can use the Transitioned signal (signal inside State script)... Checking if State is Active If you need to check if a state is active while inside of the state, for example, inside the EnemyIdle state you are checking the on area entered(): (you might already be getting an 'Cannot change state from a non-active state') you can use the active boolean included inside the State class to check if the state is currently active. [!NOTE] This applies to any functions that could run at anytime (such as area entered , area exited , etc). Support If you have any issues, create an Issue or message me on Discord at itsmealec .","default_branch":null,"files":null,"tree":[],"storefront":"/r/AlecSouthward","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/AlecSouthward/state-machine/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}