Page 1 of 1

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

Posted: Fri Feb 15, 2019 6:53 pm
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

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

Posted: Fri Feb 15, 2019 10:51 pm
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.

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

Posted: Sat Feb 16, 2019 12:01 am
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

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

Posted: Sat Feb 16, 2019 8:12 am
by Tony Li
Yeah, that animated gif one was pretty crazy. I'm glad this one was easier. :-)