Can't get Audio Component to Play !?

Hi all,

Perhaps someone can help explain what I am missing here? I am trying to play a sound that I can turn off later… I know i need to use an Audio Component, not a fire and forget Play Sound at Location… but for the life of me i cannot get an audio component to even play? Here is my script. Bottom works just fine, but top does nadda… I am stoopid or?

Use Play sound attached, it has a Return value which you can use for the Stop function. You don’t actually need an audio component either. See example below.

With the way you have it setup there is no location for the sound to play at. DEDRICK’s version add’s it into a location on the scene so that you can hear it.

Thanks for that. Make sense, although I’m not sure then what the play()function is then for exactly.

If I am just wanting to play background music or music in a menu system, what should I attach the component to?

Just a thought, what are the attenuation settings on the SoundCue you’re using? The PlaySoundAtLocation function is playing from the world origin location (0,0,0) but your AudioComponent function is playing from wherever the origin of that Blueprint is. But in general, and AudioComponent is the way to do this :).
Best-
Zak

There has been pass 5 years sice you post this problem you have, if you still have it, the you should create the sound component first, and then you can use the sound component to assign sound, playing them and get an event when playing the sound finish. I post an image to represent waht you need to do.

First create the component, if not, it will be empty.

And now use it.

In the example, i use some variables to play sounds in my game’s presentation, i am recycle the audio files when one of then finish playing.
Hope this helps, if you do not find your answer in this five years, and sorry for the delay.

2 Likes

Thanks a lot! This helps

Thanks a lot bro, It works well.