Page 1 of 1

OnClick trigger

Posted: Tue May 21, 2019 5:59 am
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!

Re: OnClick trigger

Posted: Tue May 21, 2019 8:47 am
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

Re: OnClick trigger

Posted: Tue May 21, 2019 8:56 am
by MFB
Ah, perfect!

Thank you ever so much :D

Re: OnClick trigger

Posted: Tue May 21, 2019 9:15 am
by Tony Li
Glad to help!

Re: OnClick trigger

Posted: Wed May 22, 2019 4:48 pm
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?

Re: OnClick trigger

Posted: Wed May 22, 2019 4:54 pm
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.