OnClick trigger

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
MFB
Posts: 6
Joined: Tue May 21, 2019 5:52 am

OnClick trigger

Post by MFB »

Hello!
Recently purchased the dialogue system asset and so far it's working great! Extremely surprised at just how much stuff and how fleshed out it is!

So with that said, pardon if this is already a readily accessible feature that I have yet to find, but I was wondering what your advice was/if it would be possible to use, for example, the dialogue system trigger component with an OnClick trigger. My game mostly revolves around point and click so I don't really have a character that moves around and enters triggers or collides etc, so I was wondering how to best trigger dialogues and enabling me to use components like the dialogue system trigger is best achieved when a click/tap is the input.

Thanks for your time!
Last edited by MFB on Tue May 21, 2019 8:48 am, edited 1 time in total.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnClick trigger

Post by Tony Li »

Hi,

Thanks for using the Dialogue System!

Set your Dialogue System Trigger to OnUse. Then configure your OnClick() event to call its DialogueSystemTrigger.OnUse() method.

Another way to do point-and-click is to add a Selector component to your scene and set its Select At dropdown to Mouse Position. Then add these components to an object in the scene:
  • Some kind of collider
  • Usable
  • Dialogue System Trigger set to OnUse
MFB
Posts: 6
Joined: Tue May 21, 2019 5:52 am

Re: OnClick trigger

Post by MFB »

Ah, perfect!

Thank you ever so much :D
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnClick trigger

Post by Tony Li »

Glad to help!
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: OnClick trigger

Post by AoF »

Tony Li wrote: Tue May 21, 2019 8:47 am Then configure your OnClick() event to call its DialogueSystemTrigger.OnUse() method.
Sorry I feel dumb for asking this, but where is this OnClick() that can be configured? If that's another part of the System Trigger Script, I'm not able to find it.

EDIT: I think the context I was missing is the OP made a trigger already?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnClick trigger

Post by Tony Li »

Yes. I assumed MFB was referring to a UI button's OnClick() event and wanted to configure it to call the Dialogue System Trigger's OnUse() method.
Post Reply