Can you make sounds muffled from a specific distance?

I was wondering is it possible to make a script that allows a sounds to become muffled when the player is a specific distance? lets say your distance is 100 then the sounds slowly becomes muffled or echoed?

just kinda came up in my head today and maybe someone knows? probably not though :laughing:

1 Like

You could try to tweak the Volume of the Sound using magnitude.

Try this in a Local Script inside starter character scripts:

local HumanoidRootPart = script.Parent.HumanoidRootPart
local soundedPart = workspace.SoundedPart

while wait() do

 local magnitude = (HumanoidRootPart.Position - soundedPart.Position).Magnitude

 local magFloor = math.floor(magnitude)

 soundedPart.Sound.Volume = magFloor / 100

end

Why do all this though if the sound has a min and max roll off distance for this very purpose?

If you use min and max roll off distance and do the following that i found online, you can achieve your effect:

So parent the muffled sound effect to your chosen audio coupled with the roll off distances and you can achieve your effect.

1 Like