Trigger based on Response Input

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
dhishii
Posts: 16
Joined: Fri Dec 20, 2019 4:00 am

Trigger based on Response Input

Post 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
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger based on Response Input

Post 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))
dhishii
Posts: 16
Joined: Fri Dec 20, 2019 4:00 am

Re: Trigger based on Response Input

Post by dhishii »

I will try that. Thank you!
Post Reply