Play audio when game is paused, stop it when game is unpaused

Hello,

I am trying to have a 2d sound spawn when the game is paused (this works) and stop when I resume (having trouble with this).

I would also ideally like to stop the level sounds when the game is paused, tried do this with an Event Tick and Is Game Paused node with no luck…

Just looking for someone to point me in the right direction

Thanks.

Seeing at the menu music music isn’t assigned in pause menu, it makes sense that it wouldn’t go away when the game is unpaused. You spawn the sound and then it just sits there. You’re not stopping the sound anywhere that I can see. You’ll have to stop the sound when you unpause the game. My suggestion would be to create a variable to store your spawned sound info and then in the pause menu BP get your character, get the sound variable you created, and stop the sound.

Here’s an example.

Character class where the game is paused:

PauseMenu BP where game is unpaused by button press

This plays a sound when my game is paused and stops it when it is unpaused.

Your second problem, stopping sounds created in the level blueprint, is a lot trickier since as far as I know you cannot reference the level blueprint in any other blueprint. If you’re just playing 2D sounds I would recommend moving them to the player blueprint or some other blueprint you can easily access them.

Hey the cast worked great, I actually had this setup previously but forgot to connect the cast event to the stop function event. I ended up using an ambient sound blueprint for the level, it already has a setting to stop when the game is in a pause state. Appreciate the help, thanks.