How to Stop audio from playing (Play Sound at Location)

Hi,

I’ve made audio that plays with trigger box entering an cave But it carry’s on Going outside of the cave how can i stop the sound when i go back out of the cave? I also have got ReTriggerable Delay So it can re-play entering the cave.
I tried Destroy Actor but it don’t Play the Sound at all when entering the cave/trigger box.

Also is there a way to Fade the Sound in when entering the cave and then Fading out going out of the cave?

Thanks,
TSDREX.

You should be able to use a Stop node on End Overlap.

To your second question, yes, there are Fade In and Fade Out nodes available.

So i should make a new trigger box with End Overlap?

Sorry still new to UE4.

Here’s what i’ve got to trigger the sound

Here’s a more comprehensive answer for you.

First, select your trigger volume in the level. When you have something selected in the level, it allows you to reference it in the level BP and bring up special functions specific to it. With your trigger selected, right click in the level BP, and you can type in “end overlap” to get the function. This will trigger an event when your player leaves the volume.

Next, put your audio file in the level itself. For ease of access and reference, put it somewhere in your trigger volume. You can simply drag the audio file from the Content Browser into the level like you would any other asset.

Now that it’s in the level, select it and right click in the level BP. Select the option to create a reference for it. This is very useful for any assets that you’ll be managing from a level overhead. My sound here is called Whoosh_5. Beautiful, I know.

Now that the little reference variable is there, drag out the pin from it to access commands specific to its type. Type in “fade” to see the Fade In and Fade Out options.

Now setup Fade In to occur on Begin Overlap, and Fade Out to occur on End Overlap. Pay attention to the settings in these nodes. Fade In Duration will determine how long the fade in happens, so make sure you set it to something other than its default of 0. You also set to what volume it will fade in our out to (usually you will keep this at 1 for fade in and 0 for fade out if you are wanting the sound to actually start and stop), and set the start time for the fade in. For starting a sound, you’ll want to keep it at its default of 0.

My best advice though would be to play around! See what kind of options you get when referencing different assets and try stuff out. Have fun!

Let me know if you need any more info!

2 Likes

I gave a more comprehensive answer for you :slight_smile:

Thanks man ! :slight_smile: so i should re-do my sound patch and copy yours? Fade in and out etc?

Many thanks

Yeah go ahead and just mimic what I did and it should give you exactly what you were looking for

Hey just checking! Did it work out just fine?

Sorry for no replies been applying for Game Design at different universities. I’m going to try Now loading my project up… :slight_smile: Just stressed that i can;t work out how to create first Person arms with a sword for UE4 i’ve tried tutorials but they all mostly for Unity (tried using MakeHuman with blender export to UE4 didn’t work out great lol)

Checking in again! Everything going well with this issue?

DG Gage - I was having the same problem, then I came across this question, and it helped a lot. However I have one question if you don’t mind me asking, How do I make it so it doesn’t play the sound when I’m not in the box trigger? I am very far away from it in the game, and it will still play the sound. If I go into it however, it will fade in, and when I go out, it fades out, THEN the sound stops. How do I fix that, and what is it that’s doing that?

Couple ways:

  • You could select the sound actor in the level and set its volume multiplier to 0 in the editor, and then set its volume multiplier to 1 in the level BP on Begin Overlap along with the Fade In.
  • In the level BP, use a Stop node for the audio actor reference on Begin Play.

That should also pretty much answer your question of WHY the sound is playing when you begin the level; you never told it NOT to.