How do I Fade Sound According to Distance?

Hey everyone,

I want to know how to fade sound using distance. When the player goes far, the sound should be low, and when the player goes near, the sound should be loud. Is it using RollOffMin and RollOffMax?

Currently, the sounds are in a Tool;

image
(this image shows what the sounds are parented to)

Regardless of how far the player is, the sound produced by the tool is loud and constant.

I would like the sound to diminish as Player A (listener) moves farther away from Player B’s tool.

Thank you for your time.

Any help would be appreciated.
Thank you!!

RollOffMin is how far away the sound starts to decrease in volume.
RollOffMax is the max distance away someone could hear the sound.

So
distance from sound < RollOffMin == full volume
distance from sound between RollOffMin and RollOffMax == decreasingVolume
distance from sound > RollOffMax == no sound

1 Like

Sounds only spatially decrease volume if they’re parented to a BasePart or Attachment. Parenting the sound to the tool’s handle (which is presumably a BasePart) or to an Attachment in the tool should automatically allow for the distance based sound.

2 Likes

Oh god, thank you so much bro, that really helped me, so a Attachment will do ya?
thanks a lot!!! I wish you a good day!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.