Reply To: Problem with currentStateName in nested FSM

NodeCanvas Forums Support Problem with currentStateName in nested FSM Reply To: Problem with currentStateName in nested FSM

#10958
Gavalakis
Keymaster

Hello,

The way currentState is designed to work now, is that it returns the State only within the FSM it is called from. Each FSM holds it’s own currentState. Thus ‘agent.behaviour.currentStateName’ will return the root FSM (one assigned in FSMOwner) current State name.
Here is a workaround to get the current state name of the task’s own FSM from within an action/condition task:

Let me know if that works for you.
I will certainly look after a simple method to get the current state from the FSMOwner regardless of nested or root as well.

Thanks!

Join us on Discord: https://discord.gg/97q2Rjh