Delay for trigger

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Delay for trigger

Post 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
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Delay for trigger

Post 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
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Delay for trigger

Post by nivlekius »

Awesome, thanks. I knew there had to be something. You've thought of everything in this. :D
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Delay for trigger

Post by Tony Li »

Glad to help! :-)
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Delay for trigger

Post 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.
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Delay for trigger

Post 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.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Delay for trigger

Post by Tony Li »

Thank you very much! I really appreciate it.
Post Reply