Prefab with Audio Source question

I am using a prefab with an audio source attached to it and is used only if you click on the prefab to play a short sound (click sound). There is a scene that I am using this prefab for ~50 times. There is no problem at all, it works great but I was just wondering is it a bad practice to have so many prefabs each one using its own audio source?

Thank you.

1 Answer

1

@Gng357 it’s not exactly bad though best practice is to create a sound manager with that audio source (if the source isn’t position related nor it will be played more than once in at the same time) and call it from all of your prefabs.

@dargonknight I changed it already. I have one AudioSource attached to the script of that scene and from there that I am instantiating the prefabs, I have a function on click for each of the prefabs to play the sound instead of having an AudioSource on the prefab. Thank you for your reply :)

–