Only play audio 2 when audio 1 finishes?

Updated on February 28, 2018 in [A] Brackeys Courses
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on February 28, 2018

Hi all, I am having a lot of trouble with this. I am following Brackeys tutorial on making an Audio Manager, and am using it to manage audio dialogue clips. My problem is that if a player triggers the next dialogue too fast, then the audio overlaps with any other clip that is still playing. Is there a way to only play the next audio when the current audio finishes?

  • Liked by
Reply
0 on February 28, 2018

You could either:

 

check if the 1st one is finished with

audioSource.isPlaying

and just not allow the 2nd one to trigger until isPlaying == false

 

or

 

You could just force stop the 1st one with

audioSource.Stop()

and let the 2nd one start instantly like you already are

 

  • Liked by
Reply
Cancel
0 on February 28, 2018

Thanks Mouledoux, I’ll give it a try!

  • Liked by
Reply
Cancel