Make an AudioSource outside of the methods and name it audioSource for example. Put in an if statement put audioSource.Stop();
It will look like this
AudioSource audioSource;
void Start(){
}
void Update(){
if(condition){
audioSource.Stop();
}
}
I hope this is what you are looking for. Tell me if this doesn't work because my computer is crashed so I can't check but I did go on Unitys Scripting API. Thanks
Comments
Make an AudioSource outside of the methods and name it audioSource for example. Put in an if statement put audioSource.Stop();
It will look like this
AudioSource audioSource;
void Start(){
}
void Update(){
if(condition){
audioSource.Stop();
}
}
I hope this is what you are looking for. Tell me if this doesn't work because my computer is crashed so I can't check but I did go on Unitys Scripting API. Thanks