I'm trying to make a FSM that controls character and found it rather difficult.
I used 2 FSM: input and animation, input is for collecting input and send those event to animation FSM, animation is for playing animation.
I have the FSMs setup like this:
One thing I find difficult is that the player must be in a certain animation state at a time and those states are closely bound by the input axis (right and idle relations), and this graph become self contained and there is no good way to detect things such as fire button down unless I check the input in every substate but as the animation graph gets bigger things will become more complex and hard to manage. So I plan to use fire and jump button down as global transition so it can break out the graph. But the question is how do I return to the previous state graph once the global transition is complete? And is there a more efficient way of organizing those relations?
Please advise.