I am using FSM in my game and i have implemented some allowed transitions
I wonder how do I catch the exceptions so that the game doesn’t crash when there is a request for an ilegal transition. Instead of crashing I just want it to not do anything and stay in the current state
can I do that?
You may want to look into the defaultFilter function in the FSM. More information about it can be found in the FSM class description in the documentation.
Essentially, a defaultFilter could call getCurrentOrNextState() and determine that the desired state is the same as the current state, then ignore the request.