UI button to start a conversation?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
annathehank
Posts: 95
Joined: Sun May 03, 2020 2:17 pm

UI button to start a conversation?

Post by annathehank »

Hi again, today is not that day it seems :lol:

I'm trying to figure out how to get a conversation to start when the player clicks on a button. I feel like I'm missing something very obvious and am just complicating the process, but I haven't figured out what that is yet.

I have been looking at the manual and think I need to use the standard UI versions of the usable and selector components, I just can't quite figure out how they work. I tried setting it up so that the main camera (which is the player since it's 2D first-person à la visual novel style) had a selector component and a selector use standard UI elements. And then I gave my button the Standard Usable Unity UI. The button has the system trigger that says on use play conversation. I then gave the Standard UI Selector Elements to the canvas the button is on.

I guess I'm just mainly confused on how to set up or establish the UI selector/usable information, such as what to put in each of the slots to make it work.

Or is this all null and there's a way to get the on-click function of the button to run a conversation?

Thanks in advance, again <3
User avatar
Tony Li
Posts: 21957
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI button to start a conversation?

Post by Tony Li »

Hi,

It's much easier than that. Add a Dialogue System Trigger to your UI Button. Select Add Action > Start Conversation. Configure the UI Button's OnClick() event to call DialogueSystemTrigger.OnUse.
annathehank
Posts: 95
Joined: Sun May 03, 2020 2:17 pm

Re: UI button to start a conversation?

Post by annathehank »

I knew there was something easier!!! :lol: Thank you very much!!!
User avatar
Tony Li
Posts: 21957
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI button to start a conversation?

Post by Tony Li »

Happy to help!
Post Reply