Reference Lost On Play

Forums 💬 NodeCanvas ⚙️ Support Reference Lost On Play

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17297
    atmuc
    Participant

      I select FSM Game Owner object. In this FSM, I have a button clicked condition. While it is not playing I set button from a scene game object. I save the scene. I play and stop on the editor. Button reference becomes None.

      #17300
      Gavalakis
      Keymaster

        Hmm.. That’s very weird.
        Are both FSMOwner and Button gameobjects, scene hierarchy objects, or is FSMOwner a prefab by any chance?
        What version of NodeCanvas are you using by the way?

        Thanks.

        #17299
        atmuc
        Participant

          all are scene objects. none of them is a prefab.
          I use the latest asset store version. I use fsm as an asset not a bound version.

          #17298
          Gavalakis
          Keymaster

            Hello again and very sorry for the late reply.

            This happens because the fsm is an asset reference. Assets (like an asset graph) can’t have scene object references.
            This is generally a Unity “thing” and how Unity works though rather that a NodeCanvas specific issue.
            The workaround to make it possible to use scene object references when using asset graphs, is to do so through the blackboard variables.
            Because Blackboard is a component that lives on the gameobject which is in the scene (unless it is a prefab), it CAN have scene object references, but scene object references directly assigned to the asset graph object fields, will not work.

            The other way around (if possible), would of course simply be to use bound graphs instead, but depending on the situation (eg reused graph asset) it might not always be desirable and in which case Blackboard variables are the way to go.

            Let me know if that explains why it’s happening and if that works for you.
            Thank you.

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