- Home /
Question by
artbohr · Nov 02, 2014 at 09:27 PM ·
audiosourceaudioclipunity 4.6stop
Stopping AudioClip/AudioSource C#
Hello, I'm trying to make the previous AudioClip/AudioSource to stop, before playing the next AudioClip/AudioSource, when I click the button (the play should intiate (that works)) but when I click another button I want the audio to stop, and the new one to begin. I searched but can't find an answer on how to do it.
I have unity 4.6 with the new UI, can't also stop it with this new OnClick panel (on the new UI) can' find the function to do it.
Help Please.
C# code
Comment
You must have a reference to the AudioSource component you want to stop.
I believe it's just myAudioSource.Stop();