HUD audio help

Hello!

Ive run into a little problem that may be easy to solve as i don’t have much knowledge of using audio in UE4 yet and have not found much on this problem.
Basically i have an in game pause menu that is drawn on the HUD with a HUD BP and when i scroll over the buttons in the menu i want a sound to play. All i have found to play a sound is ‘Play sound and location’ and ‘At attached’ and neither of these work as the HUD BP isn’t actually in the scene as such.

Any idea how i could get some sounds to play from the HUD BP?

Cheers :slight_smile:

You can go to your player controller blueprint and create a custom event . which plays the sound/music you require.
And then in you HUD Blueprint, when your pause menu part is active you can cast to the player controller to get access your custom event so it fires. and to stop the music when the paused menu is closed do similar but stop the music.

If your game is paused, you may be having difficulty because all sounds are also paused by default. You need to make sure that your sounds have a sound class set and that your sound class has ‘Is UISound’ ticked. This will allow your sound to play on the pause menu, then as long as your sound has no attenuation set, you should be able to use play sound at location with coordinates 0,0,0 as the location isn’t really used.

Perfect! thanks buddy :slight_smile:

But If you want an other music during your game pause this is for you

yo sup guys I had the same problem like you guys ive spend 50 hours of research my self in bp node
but i just found the way to put a dam music pause menu it extremly simple finaly lol

just loock at that pic [url]https://gyazo.com/c28b0d0932f836352ad0bfa71171792f[/url]

it should all fix yours
if u cant see the image ill descrybe it : in my event graph pause menu ive add ( Event Construct → Spawn sound 2d ) that bring the music but for close the music i add in same widget (Event Destruct → Fade out ) u onlly need to connect the return value from the spawn sound 2d to the target of the node fade out ! and there u go hahahaha

am mad at my self all that time wasted for only this **** lol