- Home /
Can't play multiple sounds at once
I made some fireworks and when i shoot 1 firework it makes a sound when it explodes but when i shoot 10+ fireworks and it explodes there is no sound or sound is really bad. Why is that? and i have multiple audio sources.
Try using AudioSource.PlayOneShot()
. Documentation here
AudioSource.PlayOneShot does not cancel clips that are already being played by AudioSource.PlayOneShot and AudioSource.Play
@$$anonymous$$V03
@Llama_w_2Ls i have PlayOneShot but the problem is that if i shoot multiple fireworks the sound just stop even if all the fireworks have there own audio source.
How are you playing the sound on the fireworks? (script). I used a script to do something similar and it works fine. @$$anonymous$$V03
I did some test and when i don't use the firework script the audio works so i think its in my firework script. I will try to fix it. Still thx for helping.
Answer by logicandchaos · Dec 23, 2020 at 08:06 PM
Look into sound managers, there a re a few free ones on the asset store.
@logicandchaos i did but they don't have what i want. I need when you ignite the firework it plays a sound and when it explodes in they air it also needs to make a sound but only when the effect also plays.
What do you mean they don't have what you want? All the sound manager does is allows you to play multiple sounds at once. You still need to code it to play a sound when you want it to. When you ignite the fireworks you just add in a line like Sound$$anonymous$$anager.Instance.Play(FireworksSound);
Answer by CmdrZin · Dec 25, 2020 at 07:29 PM
see https://docs.unity3d.com/Manual/AudioMixer.html
"The Unity Audio Mixer allows you to mix various audio sources ..."
Your answer
Follow this Question
Related Questions
Button doesn't play sound after different button press 0 Answers
Accessing multiple audio devices 1 Answer
TOD script editing (sounds) 0 Answers
How to make sound effects ??? 2 Answers
Audio not coming out of speakers 1 Answer