Hi, here is my script,
function () {
while(true) {
if (Input.GetKey ("s")){
audio.volume = 0.0;
yield WaitForSeconds(3);
audio.volume = 1.0;
}
}
}
It’s supposed to mute the volume for three seconds after the S key is pushed. I wrote it myself and put it into Unity as a Java script, but something seems to be wrong with it. Maybe one of your more skilled minds can figure out the problem. I’ve tried but nothing seems to work. Thanks for reading!
-Rov