- Home /
What is the best way to handle spawned audio sources ?
There are usually 2D sounds wich are set to play on awake and loop throughtout gameplay . I'm fine with that.
but when it comes to playing 3D sounds on something like a rocket i'm wondering if i should just say AudioSource.Play()
or should I spawn a new AudioSource each time i fire the rocket and reduce the priority of each spawned audio source over time?
i'm thinking od spawning a new audio source for each pocket that is fired.
I'm not too sure of what to do.
Hello,
1) To play 3D sound, make sure you imported the rocket sound clip as a 3D sound.
2) Attach an audioSource to the rocket everytime you spawn one. Play and loop that clip.
" should I spawn a new AudioSource each time i fire the rocket and reduce the priority of each spawned audio source over time?" I don't understand what you mean with this :p
3) If it is a 3D sound, when the rockets are far you won't hear them anymore, You might have to set the 3D settings of your AudioSource at runtime to know what are the best settings for your game.
i'm not an audio expert lol (obvious truth) but AudioSource priority levels deter$$anonymous$$ed which audio is more audible , so if i have 20 audio sources playing at the same time , the one with the lowest priority may not be heard .
so if i fire off 20 rockets ,each having a spawned AudioSource without reducing the priority level of the previously spawned audio source over time then i may end up with choppy playback.
if i do attach an AudioSource to each rocket then it will sound as if the sound of a rocket being fired is on the rocket and not around what fired it , which is why i'm not sure of what to do .
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Passing Java String to C# for use in Wwise Post Event = Fail 0 Answers