OnClick button does not work? Trying to make a pause menu

So I have a Pause Menu and for my resume button I have the following code:

		(fps.GetComponent("MouseLook") as MonoBehaviour).enabled = true;
		pauseCanvas.enabled= false;
		Time.timeScale = 1;
		Screen.lockCursor = true;
		Cursor.visible = false;

But once I try to click on the resume button during runtime, the game does not resume.
The pause menu is attached to canvas whereas the script of the pause menu is on the main object. and I have an eventsystem and graphic raycaster on my canvas. What could be wrong?

try to debug your Resume add

Debug.Log("Resume");

and if you click your Resume Button that should pop up in your console. if not there is problem with your button.

Are you using the new Unity UI.
If yes, then on the pause button go the on Click ().
Click on +, add the gameobject which has the script.
From the drop down, select the method you need to call.

The next thing to is:

  1. Set the TimeScale to 0. [ Time.timeScale = 0 ;]
  2. Enable the Pause panel.