I try to find the current state running on my nested FSM but i can’t…
The FSMOwner.behaviour.currentState return the nested FSM and not the currentState IN the nested FSM …
You can use the NestedFSMNode reference to access the nested FSM instanced and thereby figure out the current state of a nested FSM. Of course you’ll need to look for the right NestedFSMNode instance in your main FSM first.
Yes, the FSMOwner.behaviour.currentState, returns the current state of the root fsm (since .behaviour property returns that root FSM object).
What @zsoik said is correct (thanks!) You will need to first find the NestedFSMNode which is the node that actually wraps that SubFSM.
I’ve also added on the roadmap to add a method in FSMOwner to return the current state taking into account SubFSM as well.
For the moment I loop throught nestedFSM (by testing if it’s a nestedFSM … thank you reflection ! ) to find the current state.
We also have problems with currentState, it seem to not be correct when the FSM switch between nestedFSM (see my other topic)and return null some time.