I have this script (it’s only part of one), and it won’t work. I want to stop the sound but it says some errors.
Script:
if(sound){
if(Input.GetMouseButtonDown(0) enter open){
AudioSource.PlayClipAtPoint(openSound, transform.position);
audio.clip = closeSound;
audio.Stop(closeSound); //line 42
}
if(Input.GetMouseButtonDown(0) enter !open){
AudioSource.PlayClipAtPoint(closeSound, transform.position);
audio.clip = openSound;
audio.Stop(openSound); //line 48
}
if(Input.GetMouseButtonDown(0) locked enter2){
AudioSource.PlayClipAtPoint(lockedSound, transform.position);
}
}
Errors:
Please help! Thanks in advance!