Page 1 of 1

Trigger based on Response Input

Posted: Tue Mar 31, 2020 1:04 am
by dhishii
Hi,
I want to trigger the activation of a GameObject in the scene based on the players response. I was reading that you can trigger events, with ScriptableObjects, but was it possible to activate a GameObject in the scene instead?

Dialogue Setup
Image

If the user clicks "B", I wanted to activate the TriggerEvent on TentaclesForest(1)
Image

Re: Trigger based on Response Input

Posted: Tue Mar 31, 2020 8:23 am
by Tony Li
Hi,

In general, it's best to ignore the OnExecute() event in the dialogue entry node inspector. It has very specific, limited uses.

Instead, use sequencer commands. (See: Cutscene Sequences)

To activate a GameObject, use SetActive():

Code: Select all

SetActive(Tentacles Tunnel (1))
However, it looks like what you really want to do it call the ShowEmote() method in the GameObject's PopupEmote script. If so, use SendMessage():

Code: Select all

SetMessage(PopupEmote, !!!, Tentacles Tunnel (1))

Re: Trigger based on Response Input

Posted: Wed Apr 01, 2020 4:13 am
by dhishii
I will try that. Thank you!