// Update is called once per frame void Update() { GameObject cc = GameObject.Find("Main Camera"); CustomCursor other = (CustomCursor)cc.GetComponent(typeof(CustomCursor)); if (isPaused) { pauseMenuCanvas.SetActive(true); other.OnDisable(); Time.timeScale = 0f; } else { pauseMenuCanvas.SetActive(false); other.SetCustomCursor(); Time.timeScale = 1f; } if (Input.GetKeyDown(KeyCode.Escape)) { isPaused = !isPaused; } }