Last updated
Last updated
You can use the Sequential Run State Machine or SRSM to run things in a sequential order, waiting for a condition to be true in order to continue to the next state
First you create the enum class with all of your states
Then, instantiate the builder class, as seen on the first line
Then, add your .state() and .onEnter() methods, these will be the basis of your entire SM
Then, add your .transition() conditions in order to continue through the states, when it returns true, it will pass through and go to the next condition
Then, use the .build command to start the machine
Finally use the .start() and .update() function in order to start and update the SRSM, the .update must be called every "loop" in your code
If you use .isRunning condition, it will return just that, if the SRSM is running or not