Reply To: DialogueTree SetActorReference not working reliable

NodeCanvas Forums Support DialogueTree SetActorReference not working reliable Reply To: DialogueTree SetActorReference not working reliable

#14496
Gavalakis
Keymaster

Hello and very sorry for late reply due to summer vacation!

Yes, that is correct. Indeed, a copy of the original asset (Dialogue Tree in this case) is instantiated as soon as the Dialogue starts, if the dialogueTreeController.behaviour is not already an instance previously created.
Thus, the correct way of setting the actor references or altering the dialogue tree in any other way, would be what you came up doing :). You can also replace this, dialogTreeController.behaviour.SetActorReference(“Other”, other);, directly with this dialogueTreeController.SetActorReference("Other", other). Of course after you call “StartDialogue” like you do first.

I could also probably add a new method override like DialogueTreeController.StartDialogue(DialogueTree tree, IDialogueActor instigator, Action<bool> callback, so that you both set and start a new tree with one call for more convenience.

Thanks!

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