I’m trying to create a multiple animation system for the player, but I’m not sure what the best approach is. In particular, I need to handle these states:
idle
moving
idle + shooting
moving + shooting
throwing a grenade while idle
throwing a grenade while moving
animation when touching / pressing a button
In your opinion, what is the cleanest and most efficient method to manage this?
Is it better to use state variables, booleans, a finite state machine, or to manage everything directly through event conditions?
If you have examples, screenshots of events, or even just some practical advice, it would be really helpful
Thanks a lot in advance!
My go to with these things is a finite state machine. In the example below, the guard’s state is stored in an object variable Action, and the expanded events show the transition from when the player has been spotted (falls in the line of sight of a guard) to chasing the player, and checking for the player when the guard has reached the position they spotted the player at: