I have a few close triggers in a level that if the player hits, play voice over. But if the player hits one after another, the audio overlaps. I put this code together in the level blueprint to delay the second audio, but the more triggers around the area, the more branches it needs.
Yes that is correct. The code works well for two nearby trigger boxes, but when there are multiple trigger boxes and can be approached from different angles, it leads to each trigger needing multiple checks for every voice over in the immediate area.
I would do as @pezzott1 suggested and have an actor manage your audio, however, this works in the level blueprint.
As an after thought you should also have a check for if the array length is 0 to avoid any unnecessary looping/potential bugs. I’d add this at the start of the custom event before the check for IsTimerActiveByHandle.
Thank you so much, this worked like a charm.
For the afterthought, I added a length check for the Sound Queue, after the PlaySound custom event. If the value’s greater than zero, it continues through the branch. If it’s zero, the Sound Queue is cleared of all content. Hopefully that does the trick.