Page 1 of 1

Delay for trigger

Posted: Wed Mar 13, 2019 9:24 pm
by nivlekius
So, I was thinking of doing this with code and it would be quite easy but I thought, there's gotta be someway to do this without adding another script. So, how would I go about delaying triggers for a certain amount of time before it can retrigger? I want my player to get away from the NPC before the dialogue window comes back up. Basically, I don't want to npc to talk every single time the player triggers it. I would like for there to be some down time in there after first time they entered the conversation.

Thanks

Re: Delay for trigger

Posted: Wed Mar 13, 2019 10:10 pm
by Tony Li
Hi,

Use a TimedEvent component. Here's an example:

Image

This example plays an alert message, but the same idea applies for whatever you use the Dialogue System Trigger for, such as starting a conversation. Here's an annotated version of the screenshot that explains what it does:

Image

Re: Delay for trigger

Posted: Wed Mar 13, 2019 10:29 pm
by nivlekius
Awesome, thanks. I knew there had to be something. You've thought of everything in this. :D

Re: Delay for trigger

Posted: Wed Mar 13, 2019 10:40 pm
by Tony Li
Glad to help! :-)

Re: Delay for trigger

Posted: Wed Mar 13, 2019 11:35 pm
by nivlekius
I had already started to do it so I went ahead and just coded it into my FSM, that way I can trigger, walk away and not talk at the same time and it is working beautifully. That said, I am still grateful you showed me the timer. I'm sure it will come in handy. I bookmarked this page to my unity section so I can check out the image when I need to. I'm gonna leave you another glowing review on the store a little later. Best support ever.

Re: Delay for trigger

Posted: Wed Mar 13, 2019 11:45 pm
by nivlekius
Review done, gave you 2 stars!
j/k I gave you 5 of course!

I mean it cost me $65 but to me it's worth a heck of a lot more. I really appreciate this asset and your time.

Re: Delay for trigger

Posted: Thu Mar 14, 2019 8:24 am
by Tony Li
Thank you very much! I really appreciate it.