- Home /
Playing sound without destroying it again
Hi all, I'm new to unity sound engine. Is it possible to play for example a bounce sound, several times, but without destroying the previous instances?
There wont be a use it it!! What exactly are u trying to achieve!
I would like to have a bounce sound whenever I collide, the thing is the previous bounce gets destroyed when the new collision happens, and that's what I don't want to happen.
What is wrong with
OnCollisionEnter(Collision col){
audio.Play();
}
To truly understand, we would need to see some code. And a little more explanation.
What's wrong with the above, is when a new collision happens, the previous sound gets removed when its played again. I need to keep the previous audio.
Answer by WhendricSo · Mar 13, 2014 at 02:41 PM
(C#)
public AudioClip bounceSound;
OnCollisionEnter (Collision collision) { audio.PlayOneShot(bounceSound); }