I have a Sound inside of a model which can be toggled on and off via Gui/RemoteEvent. A button is pressed, firing the event and causing my server script to play the audio. It plays, no problem, except that the entire map can hear it. I want only those close to it to hear it as it's a siren and it's awfully annoying to hear it constantly no matter where you are. I messed with MaxDistance, MinDistance, EmitterSize, etc. to no avail. If anyone has any suggestions, please do tell.
Tiny snippet of code pertinent to the Sound:
player.Character.Car.Siren.MaxDistance = 10 player.Character.Car.Siren:Play()
You guys are over-complicating this lol. All you have to do is put the sound in a Part, then it will automatically emit its sound from that part. It even includes a Doppler effect.
Roblox is pretty bad at doing audio w/ range.
The way i've always went around this problem is to create a Folder
inside of StarterGui
, and play all Sounds
from there, calculating the volume
using magnitude
.
If you want to create a 3D sound that only one person can hear, you can create a part, clone the sound to it, place it under the player's camera, change its position. Then play the sound!