- Home /
One AudioSource on player or one assigned to every collectable (hundreds)?
Is it better to have one audio source on the player or one on each collectable object?
The sound effect is to be played for each collectable upon collection.
I am targeting iOS so performance is important.
Have one on the player, other wise you will have hundreds of the same audio loaded into the memory. If you still want to have them in the objects, then you should dynamically load them during run time when required, but the first way would still be better.
Answer by davedx · Mar 19, 2012 at 07:19 PM
Definitely on the player. The only reason to put it on another object is for the 3D/volume falloff effects (and the management of loaded sounds if things are created/destroyed dynamically). If it's being played when the player hits it then there's no reason to put it on the collectable.