How can I ensure a trigger volume only plays a sound once?

Excuse me, I’m pretty new to UE4, but i’m working on a Games Sound project for University.

I have trigger volumes that are playing audio that are located within events in FMOD Studio, however I want the sound to trigger once and once only within one play through.

My blueprint is simply an OnActorBeginOverlap linked to a PlayFmodSound (which references my fmod sound event).

Seems simple in theory, but I can’t quite suss it out. Any help would be greatly appreciated.

insert a branch after begin overlap and use a boolean variable. Use the false exe to play your sound and then set the variable to true. So on default the variable will be false, the branch will run the false execute and on the next overlapt the branch condition will be true and nothing will happen

Cheers
Evil_Fischi :wink:

Thanks for getting to me to so quick.

I’m with you, however i’m not 100 percent sure about the variable… This is what I’ve got so far? I inserted the branch as you mentioned.

223049-sketch-01.png

you are nearly there!!
Now you just need to create a variable and plug it in the branch.
Check out the documentation about variables:

So I’ve made a variable and just named it stop. Do I hook the variable up to the condition ext? Or do I hook a set-variable object to the true ext? Neither seems to work, but i’m 100 percent blaming my newby approach…
Thanks Again!

Use the node ‘DoOnce’ and plug it in before your PlaySound.

Please note that the ‘ResetMyThing’ Event is optional, and you do not need to use it. However this would allow you to reset this circuit and have your Sound Play again.

For example: Player opens door, the Sound plays, but cannot be played again.

When the Player closes the door the Reset Event is called, and for the next door opening the sound would play again!

1 Like

The branch note is an equalent to an IF so you want to check something. You check if your variable is true or false.
When do you want your sound to play or when do you don’t want it to play?
-You want it to only play once. So you want to set your “stop” to true when the sound was played the first time…
(I asume that you are not that much familiar with programming, so I will only point you to the right direction, but you need to do the last step :wink: )

A wild guess… Haha!

oh nice, didn’t know that that existed, now I have learned something new, tanks :wink:

This would have been the right answer:

Hello, Heidy. Could you please tell me how to create the custom event “ResetMyThing”, please? I’m new to programming and that’s the thing I need in order to make my code work. Hope you can help me. Thanks in advance