[SOLVED] Is it possible for a Dialogue System Trigger to work on a Button?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

[SOLVED] Is it possible for a Dialogue System Trigger to work on a Button?

Post by CodePrincess »

I need to create a pre-conversation, escapable "Topic Menu" for my 2D game. I've tried to apply it to Unity UI objects in the past, but they never seem to respond. So far, the Dialog System Trigger only responds to Box Colliders attached to Sprites.

Is there a way to make them respond to UI objects , or should I jury-rig an off-canvas menu with cubes and texture fonts?

Eternally grateful for your insight,
CodePrincess
Last edited by CodePrincess on Sat Feb 16, 2019 12:03 am, edited 1 time in total.
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Is it possible for a Dialogue System Trigger to work on a Button?

Post by Tony Li »

If I understand correctly, you can do this:

1. Create a UI button for the conversation.

2. Add a Dialogue System Trigger component to the UI button. Set its trigger dropdown to OnUse.

3. Configure the UI button's OnClick() event to call the Dialogue System Trigger's OnUse method.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Is it possible for a Dialogue System Trigger to work on a Button?

Post by CodePrincess »

... Wait. That worked? It was actually that easy?! Wow! My first ever quick fix! :-o
I was so afraid that you were going to have to guide me by the hand for days like you did with that animated gif controller issue. Which works like a charm still, by the way. :-D

Thank you very much and have a good night!
Melissa
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Is it possible for a Dialogue System Trigger to work on a Button?

Post by Tony Li »

Yeah, that animated gif one was pretty crazy. I'm glad this one was easier. :-)
Post Reply