Zentryte
(Zentryte)
June 19, 2022, 12:10am
#1
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
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
RMofSBI
(RMofSBI)
June 19, 2022, 12:34am
#3
Why do all this though if the sound has a min and max roll off distance for this very purpose?
RMofSBI
(RMofSBI)
June 19, 2022, 12:41am
#4
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