How do I make an actor play a component sound?

I need an actor to play a component sound once. How do I do that?

1 Like

You can call the function PlaySound2D from the UGameplayStatics library to play a 2D (UI) sound. If you need it to play at a 3D position you can also use AudioComponents, which support more advanced methods of playing audio.

1 Like

There are various ways, inside the Actor BP, right click search for Play Sound, there are options: Play Sound 2D, Play Sound at Location etc. Create an event or input key and attach to that selected node.

1 Like

Turns out I goofed. I was trying to play the the sound in conjunction to the actor being destroyed. But destroying the actor stops the component sound from playing.

So I had to delay the destruction to give tome for the sound to play.