public class EscMenu : MonoBehaviour {
private GameObject menu;
// Use this for initialization
void Start () {
menu = GameObject.FindGameObjectWithTag ("Menu");
menu.SetActive (false);
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown (KeyCode.Escape)) {
Debug.Log ("escape");
menu.SetActive (true);
}
}
For some reason, the if statement in Update() doesn’t run when I press the Escape button. There are no compile errors. “escape” doesn’t work, nor does the menu panel turn on.