public void resumeGame() { GameObject pauseCanvas = GameObject.Find("PauseCanvas"); PauseScript pauseScript = pauseCanvas.GetComponent <PauseScript>(); Debug.Log("Button clicked = "); pauseScript.resumeGame(); }