Hello. I hava a problem with my pause menu. I want to open it when escape key is pressed but it does nothing. I tried another keys and it worked so i don’t know where the problem is.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class myPause : MonoBehaviour
{
bool isPaused;
public GameObject Pause;
void Start()
{
isPaused = false;
Pause.SetActive(false);
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape) && isPaused == false)
{
Pause.SetActive(true);
isPaused = true;
}
if (Input.GetKeyDown(KeyCode.Escape) && isPaused == true)
{
Pause.SetActive(false);
isPaused = false;
}
}
}