Dialogue Tree Controller loses actor references after playing

Forums πŸ’¬ NodeCanvas βš™οΈ Support Dialogue Tree Controller loses actor references after playing

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17489
    kianga
    Participant

      Hi,

      I have a Dialogue Tree Controller with a Dialogue Tree asset (not bound). There are two actors referencing game objects in the scene. When I click Play, everything works fine and the dialogue starts. However, as soon as I exit play mode, both actor references revert to “None” in the inspector.

      Surprisingly, the missing actors reappear in the inspector when entering play mode (and revert back to None when exiting), but after restarting Unity these references are gone for good and I have to assign them again.

      As a workaround I’m assigning the actor references from a script when the scene starts, but it would be easier if these references could be set (and kept) via the inspector.

      RenΓ©

      #17491
      Gavalakis
      Keymaster

        Hello Rene,

        It is a Unity standard “thing” that Assets (such as Asset Graphs) can not have scene object references. This is why your scene object references are lost. Once again, please note that this is just how Unity works πŸ™‚

        With that said, I will take a look at implementing a solution to that by serializing the actor object references within the DialogueTreeController instead of within the DialoguTree, so that this can be resolved easier.

        Until then though, assigning the actor references from script via the SetActorReference and SetActorReferences functions like you do, is probably a good solution as well πŸ™‚

        Thanks for your suggestion. I will take a look at making this easier!

        #17490
        kianga
        Participant

          Ah, alright. From the inspector it looks like the actor references “belong” to the DialogueTreeController, which is part of the scene and should be able to reference other scene objects. So that’s what confused me, but your suggested change would help a lot with this. Writing an extra script just to assign the actor references feels a bit redundant. πŸ™‚

          Thanks for the reply!

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