Page 1 of 1

[Solved] Attach actor via script

Posted: Sat Nov 03, 2018 6:27 pm
by Japtor
Hi

Is it possible to attach the actor to the Dialogue System Trigger -> Actions -> Start Conversation -> Conversation Actor via script?

Thanks!

Re: Attach actor via script

Posted: Sat Nov 03, 2018 8:00 pm
by Tony Li
Hi,

Yes, you can set DialogueSystemTrigger.conversationActor. For example:

Code: Select all

GetComponent<DialogueSystemTrigger>().conversationActor = someTransform;
This assumes that you will set it before triggering the Dialogue System Trigger.

If you need to set it after triggering the Dialogue System Trigger, I can make two suggestions:

1. Leave the Conversation Actor field blank. If it's triggered by OnUse or OnTriggerEnter (or OnTriggerExit, OnCollisionEnter, or OnCollisionExit), it will automatically assign the GameObject that caused the trigger to fire.

2. Or manually change the values assigned to DialogueManager.conversationModel.actorInfo.

Re: Attach actor via script

Posted: Sun Nov 04, 2018 3:46 pm
by Japtor
Hi,

Thanks! It worked! :)

Re: [Solved] Attach actor via script

Posted: Sun Nov 04, 2018 4:19 pm
by Tony Li
Awesome! Happy to help.