- Home /
Previous audio clipped if called again
I'm trying to call a audio clip of one GameObject – multiple times.
The problem is that the previous clip gets clipped once the sound is played again.
What I want is to play the clip until the end – regardless if it is played twice or trice. Is this possible?
Check for isPlaying
http://docs.unity3d.com/Documentation/ScriptReference/AudioSource-isPlaying.html
Thanks @getyour411 but what I want is play the same sound again even if the first has not finished. But both should be audible – even if they overlap. At the moment the first is cut when the second begins. I want both to be played until the end of the clip.
O, if you declare it like
Audio myclip1
Audio myclip2
but drag/drop the same clip into both of those then Play() both, does that work?
Not sure if this works. Actually it is the same function calling the same clip again and again, fast. I'd like to avoid having to iterate through a list of the same shot sounds.
The concept is similar to consecutive shots of a machine gun with some room reverb, even if the audio overlaps for multiple shots, each and every clip should play until the end.
Right now every following shot just stops the one that is playing at the moment. And often with an unpleasant pop sound.
Your answer