Audio "Play At Location" triggers when player enters radius, long after trigger.

For some reason when I play audio through “Play At Location” in Blueprint it does NOT actually play itself if i am outside of the attenuation radius, unless I later enter the radius of the attenuation effect. The audio should have already ended long ago.

I have been unable to find any properties related to this. It creates a time rift where a player passing by something that happened a while ago, will have the audio file playing for him much later.

I’m afraid there are no ‘virtual’ sounds in Unreal, allowing sounds to play in the background if unheard. Any sound that’s asked to play will be queued up and wait to start until the system determines that its volume would be greater than 0. As a way to workaround this I would advise performing a distance check before playing the sound and if you are currently outside of the attenuation radius then don’t play the sound at all.

Thanks for your answer. I see why this works the way it does. But I do wonder why this is not a problem for ShooterGame that seems to call play sound in C++ for weaponfire etc. but never suffer from ghosting when you do come back into the other player’s radius. (The code I inspected used PlaySoundAttached)

I can have a look to be sure, I’m not sure if that takes a similar approach internally or if it’s something taken care of by replication in multiplayer.

I wouldn’t say a single distance check before playing a sound is slow, it’s different from calculating a distance to apply attenuation etc.

The thing with setting bAlwaysPlay is that it’s kind of the opposite of virtualisation, if you aren’t in hearing range you are still using up a sound channel. It’s generally reserved for sounds the player must hear like a mission objective dialogue or background music. You can also set bAlwaysPlay on an audio component, though only from code atm.

Rest assured we would really like to add virtual sounds but I think it would likely come with a large re-write of how the audio system is set up to cover a lot of issues at the same time.

This sounds like a major issue to me. Doing a distance check for every sound in the game is slow and unnecessary especially since sounds do them anyway. An actual usable workaround I found is to set bAlwaysPlay to true by using a soundclass. But soundclasses can only be assigned over soundcues so you need to add soundcues for every sound in the game which is also quite unnecessary. I am also pretty sure that this is not ideal performance wise either. So please rethink adding virtual sounds to UE4 to make life easier for everyone. Thanks.