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

**URL:** <https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739>\
**Category:** Audio\
**Tags:** reference-blueprint, play-sound-at-locati, unreal-engine, question, Blueprint\
**Created:** [December 8, 2017, 12:19pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739 "2017-12-08T12:19:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChickenGuzan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ChickenGuzan](https://forums.unrealengine.com/u/ChickenGuzan)\
**Post date:** [December 8, 2017, 12:19pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/1 "2017-12-08T12:19:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Evil\_Fischi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Evil\_Fischi](https://forums.unrealengine.com/u/Evil_Fischi)\
**Post date:** [December 8, 2017, 12:37pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/2 "2017-12-08T12:37:41Z")

</div>

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 😉

---

<div class="post-metadata">

**Author:** ![ChickenGuzan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ChickenGuzan](https://forums.unrealengine.com/u/ChickenGuzan)\
**Post date:** [December 8, 2017, 12:50pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/3 "2017-12-08T12:50:30Z")

</div>

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/5/f6523de14ee0d782029fa646d712ddd57f728171.png)

---

<div class="post-metadata">

**Author:** ![Evil\_Fischi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Evil\_Fischi](https://forums.unrealengine.com/u/Evil_Fischi)\
**Post date:** [December 8, 2017, 12:56pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/4 "2017-12-08T12:56:50Z")

</div>

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

> **[Blueprint Variables](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/)**
>
> Properties that hold a value or reference an Object or Actor in the world.

---

<div class="post-metadata">

**Author:** ![ChickenGuzan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ChickenGuzan](https://forums.unrealengine.com/u/ChickenGuzan)\
**Post date:** [December 8, 2017, 1:06pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/5 "2017-12-08T13:06:38Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Heidi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Heidi](https://forums.unrealengine.com/u/Heidi)\
**Post date:** [December 8, 2017, 1:15pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/6 "2017-12-08T13:15:04Z")

</div>

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

 ![223069-unbenannt.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/c/98ccea101f46ee8b46cfc0d8ac0aaf4df0a2d3eb.png)

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!

---

<div class="post-metadata">

**Author:** ![Evil\_Fischi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Evil\_Fischi](https://forums.unrealengine.com/u/Evil_Fischi)\
**Post date:** [December 8, 2017, 1:16pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/7 "2017-12-08T13:16:27Z")

</div>

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 😉 )

---

<div class="post-metadata">

**Author:** ![ChickenGuzan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ChickenGuzan](https://forums.unrealengine.com/u/ChickenGuzan)\
**Post date:** [December 8, 2017, 1:33pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/8 "2017-12-08T13:33:10Z")

</div>

A wild guess… Haha!

 ![223066-sketch-02.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/0/90071af7dbdb7f7e2668336f981bfe09d08a4e7e.png)

---

<div class="post-metadata">

**Author:** ![Evil\_Fischi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Evil\_Fischi](https://forums.unrealengine.com/u/Evil_Fischi)\
**Post date:** [December 8, 2017, 1:40pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/9 "2017-12-08T13:40:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Evil\_Fischi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Evil\_Fischi](https://forums.unrealengine.com/u/Evil_Fischi)\
**Post date:** [December 8, 2017, 1:44pm UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/10 "2017-12-08T13:44:52Z")

</div>

This would have been the right answer:

 ![223070-unbenannt.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/4/d/74d461eab90cb1f36192552bfa36d708652a1893.jpeg)

---

<div class="post-metadata">

**Author:** ![ToodChavezxxx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ToodChavezxxx](https://forums.unrealengine.com/u/ToodChavezxxx)\
**Post date:** [January 5, 2023, 2:17am UTC](https://forums.unrealengine.com/t/how-can-i-ensure-a-trigger-volume-only-plays-a-sound-once/411739/11 "2023-01-05T02:17:49Z")

</div>

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
