Config Setting for Audio Sources in Unity

Just an FYI for other newb Unity users, if you hear audio for some lanes but not for others - you should check the Unity config settings because it limits the number of active audio sources.

Look under:
Edit -> Project Settings -> Audio -> Max Virtual Voices

While doing this challenge I ran into a strange bug where some of my River lanes would have audio, but others that were spawned later would not… and none of my cars would have audio.

I spent several hours trying to figure out if my code was wrong before finding the config setting. My Max Virtual Voices was set to 32 and each river lane had about 10 audio sources. I was spawning 20 lanes at a time, so once 3 rivers spawned, I ran out of active audio sources and no other lanes/ cars would have sound.

Excellent work. Thank you for taking the time to share this with others.

Privacy & Terms