Simple FSM (Finite State Machine)

Just a very basic example of a FSM. It is very useful when you want to control the state of the player or ai. It is useful because everything related to the state is placed in one, singular, place and that will make it quite a bit easier to debug and control the flow of the player/ai.

Basic concept is in the provided build but it is a very simple example. Might expand upon it when I have more time. Readme text file (explanation) can be found in the engine for more explanation.
https://playcanvas.com/project/942468/overview/player-fsm

Good luck and hope this is useful to someone!

4 Likes

Did some expanding to the Simple FSM. Some of the things that are implemented are:

  • All player states
  • All AI states and their controller (that I wanted)
  • Changed FBX to models and added their animations (even layer blending…which I am terrible at).
  • Improvements all around (base state, player controller, movement and attack classes, etc.)

If you are curious, you can find the full project, and the version/change log, at:
https://playcanvas.com/project/942468/overview/player-fsm

This was fun, if someone wants me to implement something to the project, ask and I might put it in. :slight_smile:

1 Like