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.
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!
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. π