AudioEmitter plays indefinitely & without attenuation if played & then the parent instance is deleted before asset has loaded

I noticed while working on a project that sometimes when a sound effect takes a while to load, it will occasionally become loud and play indefinitely. This specifically occurs when the instance the AudioEmitter is parented to is destroyed before the AudioPlayer’s asset has loaded, and :Play() was called and is waiting for said asset to load.

How to repro:

  • In a script (local or server), insert a new AudioEmitter with AudioPlayer into either a basepart or attachment in the workspace.
  • Play the AudioPlayer within the AudioEmitter and immediately destroy the thing it is parented to
  • Result: the object will be deleted, but soon after the sound will load in and begin playing as if it is 2D within your screen, with no attenuation or direction.

If the AudioPlayer is played, then it loads and begins actually playing, then you destroy its parent AFTER it has loaded, the audio will stop playing as expected. This bug makes it so that some sounds when played for the first time could play indefinitely if set to looped.

AudioEmitter Part Destroy Repro.rbxl (73.2 KB)

Hey @ZacAttackkthere’s a flag going out with v685 that’s aimed at fixing this issue – we should be able to get it enabled in Studio and on Desktop clients today (though mobile versions are a little behind)

1 Like

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