Access "Owner" from custom state

Forums 💬 NodeCanvas 🗨️ General Discussion Access "Owner" from custom state

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15061
    mikael gyth
    Participant

      Hello.

      I have created a custom state for one of my SFM’s. And I wanted to use GetComponent in it. But it seems that I can’t.
      I had to get the object by tag before it would work.
      Is not the owner of the FSM the GameObject that I access from a custom state? Is there a way to get the gameobject of the FSM from inside a custom state?

      Br. Mikael Gyth.

      #15063
      Gavalakis
      Keymaster

        Hello,

        From within an FSMState you get access to the FSM itself with the ‘graph’ property and you get access to the agent of the FSM (which 99% is the FSMOwner) with the ‘graphAgent’ property.

        Keep in mind that the FSMOwner and the FSM itself live on different game objects.

        Is that what you mean?

        #15062
        mikael gyth
        Participant

          Yes.
          That was it. Thanks.

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