Hello,
I’ve been working at this for 2 days and I’ve had some great help, but it seems like something isn’t working right. I am using this script to toggle the mute parameter on an Audio Source:
// Mutes-Unmutes the sound of this transfor each time the user presses escape.
function Update() {
if(Input.GetKeyDown(KeyCode.Escape)) {
if(audio.mute)
audio.mute = false;
else
audio.mute = true;
}
}
This script works perfectly for muting the audio source, but it doesn’t seem to unmute the audio. Basically, if I start the scene with the mute button ticked on the audio source, it will not unmute the audio source and toggle the mute button each time I press escape. The check-mark on the mute parameter stays ticked on the audio source and no audio plays. If anybody could please help me out on this one, I would really appreciate it! Trust me, I’ve spent a ton of time on this one, and I just can’t figure it out! THANK YOU SO MUCH for your help!!