Doors with sounds: how a script should handle them

Should I have all the sounds in soundScape and come time put them into the model and play them? Or should they just sit in the model and wait? If I have 200 doors that’s 400 sounds idling at a minimum. Should I design around this simple way and go with soundScape access instead?

You could just create the sound when opened and play the sound, then insert the sound instance into the Debris service to have it removed after the sound time duration has ended.

But should I even go to the extent of doing this is what I am wondering. If the sounds have zero impact to performance as static references then it is actually less efficient to do that.

It depends how you want the sound to replicate. You cannot play sounds inside the SoundService from a server script, unless you fire a remote to tell the client to play it. If you want the server to play a sound you might want to keep your sounds in a folder inside ReplicatedStorage and call it Sounds then have the sounds for openDoor and closeDoor and when the player chooses to open or close the door have the server script:

  1. clone sound
  2. parent sound to door
  3. play the sound
  4. use the AddItem(instance, delay) method from the DebrisService for removal of the sound instance

It won’t have any performance issues since the DebrisService will handle removing the instances…