If I play a sound at location in a BP how can I stop that sound from playing?

I use the “play sound at location”- node in my blueprint to play a sound, but I want to interrupt it/stop it halfway through. How can I do this?

1 Like

Hello,

Currently Play Sound At Location is just a fire and forget sound and as such doesn’t have an AudioComponent (which is needed to start/stop a sound). This was done because we wanted to reduce the AudioComponent churn, however, it has proven somewhat difficult for people who want to use the node. At some point in the not too distant future we want to do something along the lines of adding a fire and forget Play Sound node that behaves the way the current At Location node does and make the At Location node create and return an AudioComponent like the Attached version does.

In the mean , you might be able to achieve what you are after by doing something like the following:

In your Blueprint, use the Set Sound node to assign it to an attached Audio Component (added via the Components Tab). You can then play/stop that audio component and specify the location at which the sound is played from with a Set Location node.

Give this a shot,

-W

1 Like

Thanks for that :slight_smile: I was missing the ‘‘Set Sound’’ > ‘‘New Sound’’ parameter, if that gets blank you get no sound.

I’m trying to make several objects that i can click on , all of them assigned to the E key… but i don’t understand how to do that without activating all of them at the same . Is there a way of activating the which is in proximity to the player ? The standard activation method of current games, Press E to activate and deactivate individual objects that have separate sounds for example.

Cheers.

I have same issue, did you solve it?

Hi

You would need to use an array and a menu system or logic system to do this.

Put a activation radius sphere (using a collision sphere) aroung your and when the player overlaps with this sphere (he is “close enough”) then you use the Enable Input node and when he exists overlap, use Disable Input.

Exactly like they do in the docs here: [https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/ActorInput/Blueprints/index.html#enable/disableinputusage

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/ActorInput/Blueprints/index.html#enable/disableinputusage

If I want to attach sound to a socket (that I added to a skeletal mesh), would I replace Set World Location with something else?

sadly this method does not work anymore, any other way to control my sounds?

Hello

Forgive me, it wasn´t working because I created a variable from the set sound node and for the above example works you need to add sound components inside the actor, set the default sound cue and then it will works, thanks Wes!!

thanks

Thanks it works

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.