What is the best place to put Sound, which will be used in multiple places?

Hello
What is the best place to put sound for Door opening. It will be used in scripts under many different doors.
Should I put it under each door?
Or should I put it in a single place like SoundService?

Thanks in advance

Under all doors is better because then it will play in a 3D space, so it will be realistic. Under SoundService could also work, because to open the door you have to be close to it, so it wouldnt be too noticeable that sound isnt 3D.

Alternatively you can keep one sound wherever you want (Replicated Storage for example), and in a door script when opening, clone the sound, put it in door, play it then destroy.

1 Like

If I put the Sound under the SoundService and I play it in the server script, I guess it will play for all players in the game? And no matter how far they are from the door?

No a sound can be put into workspace (or SoundService) and given a MinRollOffDistance and MaxRollOffDistance, and it will only be heard within this range, emanating from the model that contains the script calling for this sound.

If the script is a server script the sound will be heard by everyone close enough to hear it in that range specified… if its a local script only the player will hear it in this same distance range.

1 Like

So this means that if my script is under the Door model and my sound is under Sound Service, the sound will play only around the Door itself (because the script calling it is there)?
So no real need to have multiple copies of the Sound
The only difference is that I will loose some “3d” effect?

Not really… sorry, let me be clear… sounds placed in the workspace or service, will play and be heard by the server… if you want it to be locally heard, place the sound in the part.

How its heard spatially is set from the roll off distance and its properties.

Your best bet is to try all these scenarios and decide which one sounds best to u.

So MinRollOffDistance and MaxRollOffDistance will not have effect when the Sound is under SoundService?

SoundService is better for background music type sound… for other sounds workspace is just fine… for local sounds in the model or tool is fine.

If you put a sound in a part, and if its in the workspace, it’ll play at the part’s position. Soundservice is good for background/UI sounds.

MinRollOffDistance and MaxRollOffDistance is essentially the “range” of the audio, smaller means that you have to be closer to hear it, bigger means it spreads over more area.

Hope this helps!