C
C#2mo 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
Nasdack2mo ago
iirc the limit is set in project settings Audio tab
Buddy
Buddy2mo 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-1OP2mo ago
Thanks, didint think of that

Did you find this page helpful?