Sounds in parts remain even if its parent is deleted

Hello, I have an annoying bug in studio and in-game where sounds in parts still remain after locally deleted.

I have several parts with an audio in the part, and the parts parent is a folder inside of workspace.
A local script deletes the folder with everything it it, including the parts that emit the sound.
So with it all deleted the sounds should be removed as well, right? But no the sounds remain.

I’m assuming it could be something to do with it being a local script

I made one of the sound parts visible so you can see it being deleted but still having audio where it was.
And there is no chance that there’s duplicate sounds or parts still there after its deleted.


I dont know if it matters that its parent is a folder but;

The local script code deletes the whole folder and clones it from replicatedstorage on ‘else’
image

1 Like

I tried to recreate this but it seems to be stopping the sound ok for me?

local folder = game.ReplicatedStorage.Folder:Clone()
folder.Parent = workspace

folder.Part["Rock the Beat"]:Play()

task.wait(10)

folder:Destroy()

Am I doing something different?

1 Like

Hey Aerophagia; I tried this on my end (similar script to bytesleuth) but I’m not sure our setups are the same – could you attach a file that reproduces the issue?

1 Like

My best guess is that the rain sounds have PlayOnRemove = true, which is exactly what it says on the tin. Disable it.

I put it into an empty place and the issue is still occurring there.
Audio bug.rbxl (61.8 KB)
I’m gonna feel so dumb if it is just some bad code but it shouldn’t be.

Yeah, I did pretty much what you did in this before but it still didnt work.

PlayOnRemove is disabled and always has been but thank you

1 Like

Here’s a better recording showing this issue.

Wow, this is very strange I found out that adding multiple parts as opposed to the one I had in the video in the folder recreates your bug.

Hey Aerophagia; thanks for attaching a file. It looks like in this scenario there are some Sounds in workspace, as well as some in ReplicatedStorage. On my end, removing the folder in workspace causes those sounds to go silent, but the ones in ReplicatedStorage keep playing. Removing the folder in ReplicatedStorage causes the remaining sounds to go silent.

Unlike Parts – which are only visible if they’re descendants of workspace – Sounds can be played/heard from anywhere

3 Likes

Thank you so much! I was able to fix the issue by having everything muted until its in workspace.
And I didn’t know sounds that are playing can be heard in ReplicatedStorage.

2 Likes

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