FSM.GetCurrentState with nested FSM

NodeCanvas Forums Support FSM.GetCurrentState with nested FSM

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12096
    Driiade
    Participant

    Hello,

    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 …

    #12102
    zsoik
    Participant

    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.

    #12114
    Gavalakis
    Keymaster

    Hello,

    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.

    Thanks.

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

    #12126
    Driiade
    Participant

    Yeah thank you !

    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.

    We need a rapid fix for this :s

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.