Hello guys,
I've setup an actor to Bark On Trigger Enter, I made it to bark a random Bark using the RandomizeNextEntry() method. The problem is, every time I leave the trigger and walked in again, the bark triggers even if another bark is still showing.
Is there a way to avoid displaying a Bark if another Bark is still visible?
EDIT: Sorry to make it a bit more complicated, but, if possible, is it possible to do what I'm asking but for the same actor only? I'm imagining situations where multiple actors can bark and it should be possible to jump from one trigger to the other, triggering once for each of them.
Thank you.
Avoid bark to trigger when another bark is still visible
Re: Avoid bark to trigger when another bark is still visible
Add a Timed Event component to the Dialogue System Trigger GameObject. In addition to the Bark action, add an OnExecute action that does two things:
1. Disables the Dialogue System Trigger, and
2. Calls the Timed Event's StartTimer.
Configure the Timed Event's OnTimeReached() event to re-enable the Dialogue System Trigger.
Example:
Side note: If you wanted the opposite behavior -- to hide one bark as soon as another one starts -- you could use Bark Group Member components. In DemoScene2, the enemies are all Bark Group Members so only one of them can bark at a time.
1. Disables the Dialogue System Trigger, and
2. Calls the Timed Event's StartTimer.
Configure the Timed Event's OnTimeReached() event to re-enable the Dialogue System Trigger.
Example:
Side note: If you wanted the opposite behavior -- to hide one bark as soon as another one starts -- you could use Bark Group Member components. In DemoScene2, the enemies are all Bark Group Members so only one of them can bark at a time.
Re: Avoid bark to trigger when another bark is still visible
Thanks Tony, it worked like a charm!
Re: Avoid bark to trigger when another bark is still visible
Great! Glad to help.