C
C#4d ago
Status 1-1

How to stop audio from overlapping

Complete begginer, used to make games a while back but they were increadibly simple, took a very long break and now I came back. I am making a clicker in unity, when spamming the button the audio will just start overlapping. Is there a way to limit the amount of audio playing at once?
3 Replies
Nasdack
Nasdack4d ago
iirc the limit is set in project settings Audio tab
Buddy
Buddy4d ago
Or you can just check if it's playing .. Then don't play. Simple.
if (audioSource.playing) return;
// Do your thing
if (audioSource.playing) return;
// Do your thing
Something like that
Status 1-1
Status 1-1OP4d ago
Thanks, didint think of that
Want results from more Discord servers?
Add your server