FSM question

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 :smiley:
can I do that? :unamused:


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.

Best of luck!

well I have given up the allowed transitions table and implemented filters which work like a charm :smiley: thanks