How do i adjust the audio or sound that is running on my game when you are far away from the object that has the sound?
Even if ROBLOX automatically does the Distance thing if a sound is inside a 3D Object like a part. If one person is close to it and one person is far away, it would sound the same. We can use a LocalPart for that.
To make the local part use a local script. Make the Part Parent = workspace.Camera
Instance.new("Part",workspace.Camera)
This uses get distance from character.
(Local Script!)
local part = Instance.new("Part",workspace.Camera) --Change everything like size and position. local sound = Instance.new("Sound", part) --Change the SoundId and everything. local plyr = game:GetService("Players").LocalPlayer while wait() do --There is a better way to do this, I just need to write this quickly... if plyr:GetDistanceFromCharacter(part.Position) < 15 then sound.Pitch = .5 --This is an example. You may edit this script. end end
Hope this helps!(You need to edit the above script. It's just an example.)