This is supposed to not detect continously, to avoid looping through the menu. Works for the key press, but not for the button.
// Cancel
if((Input.GetKeyDown(KeyCode.Backspace) || Input.GetButton("Fire1")) ){
GoBack= true;
audio.PlayOneShot(cancelSound,MenuVolume);
}
else
{
GoBack= false;
}
I even tried with a bool to detect if the key/button is held down:
// Cancel
if((Input.GetKeyDown(KeyCode.Backspace) || Input.GetButton("Fire1")) && cancelKey){
GoBack= true;
audio.PlayOneShot(cancelSound,MenuVolume);
cancelKey=false;
}
if(!(Input.GetKeyDown(KeyCode.Backspace) && Input.GetButton("Fire1")) && !cancelKey){
GoBack= false;
cancelKey=true;
}
But that didnt work either…