PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

EmitterSize

Sound

float

The minimum distance at which a 3D Sound (direct child of a BasePart or Attachment) will begin to attenuate (decrease in volume).

Sounds parented to a BasePart or Attachment that are descendants of the Workspace are considered 3D sounds and their volume whilst playing is dependent on the distance between the client’s sound listener (Camera position by default) and the Sound’s parent. Two properties influence this behavior Sound/EmitterSize and Sound/RollOffMode.

The way the Sound attenuates (fades out) after the distance between the listener and the sound exceeds the Sound/EmitterSize is determined by Sound/RollOffMode.


Code Samples


Music Playing Part

The code in this sample demonstrates how a sound parented to a Part or Attachment will play locally and experience volume drop off the further the player’s camera is away from the part.

A part is instanced, and a sound is instanced and parented to the part. A click detector is set up on the part that will check if the sound is playing, using Sound.IsPlaying and play or stop the sound depending.