Account for all sound's playback inside of a folder

I’m using a script that utilizes playback loudness to shake the player’s screen, and I’ve got sounds in a folder called “Sounds” in my workspace. When I use this: (attached)
image
Because the folder isn’t a sound, it doesn’t account for the children inside. How would I account for all of the sounds parented under the folder?

When you want an update on the loudness, what I’m assuming you are meaning is to have the screen shake based on all of the loudness of every sound in the folder. You can account for all of the Sounds within the folder by using a for loop, looping through the children and adding their PlaybackLoudness values together every second or two. The number you get from adding them together can be used to tell whether the screen should shake or how much it shakes, etc.

1 Like

How would I write a for loop to account for all of the sounds?

Something like this

local soundFolder = workspace.Sounds

for i,v in pairs(soundFolder:GetChildren()) do
    v.Volume = 0
end