Unity sound limitation?

Hi there,

I have this issue where I have lots of sounds for my game using “AudioSource.PlayClipAtPoint(fireSound, transform.position);” and at a certain number of instantiations sound just doesn’t seem to play until the count goes down. I use it for enemy hits, player hits, player shots, item drops, explosions, enemy impact, etc.
Is this normal? Would anybody here have a good solution to this?

Hi Steven,

Without seeing the project itself it’s a little harder to give specifics, but where-ever possible, from a performance perspective, it is always going to be better to not create/destroy object unnecessarily.

Looking at your list of things you’ve mentioned I would suggest that you could use a single Audio source on a couple of those GameObjects and play the sound effects through those, each typically can manage 10-12 audio clips simultaneously. For example, your Player could be responsible for playing the player shots, and also the hits it receives (until the shot that kills it). Same goes for the enemies. Item drops, they could be responsible for an sound effect when they are spawned.

1 Like

I tried something similar and it seems to work so far. Thank you Rob and happy 2019! :partying_face:

1 Like

Hi Steven,

Great to hear you can move forward again and you’re welcome. Happy New Year to you too :slight_smile:

Privacy & Terms