OnClick() event not working

So i created a ‘Resume’ button in my paused menu and after adding the function into the OnClick() event for the button i went into play mode and it simply does nothing. There is no problem with the code since the same function works in a different instance. After some time trying to figure out what was wrong i checked youtube to see if i did anything wrong but i did not see anything that i missed/did wrong.

Thanks in advance for the help!

Please show your code. Have you put in a Debug.Log statement to confirm if it is firing?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Pause : MonoBehaviour {
public GameObject pausePanel;
public static bool paused;
// Use this for initialization
void Start () {
pausePanel.gameObject.SetActive(false);
paused=false;
}

// Update is called once per frame
void Update () {
if(Input.GetKeyDown(KeyCode.Escape)){
if(!paused){
PauseGame();
}else{
Resume();
}
}
}

public void Resume(){
Debug.Log(“Working”);
pausePanel.SetActive(false);
paused=false;
Time.timeScale = 1f;
}

public void PauseGame(){
pausePanel.SetActive(true);
paused=true;
Time.timeScale = 0f;
}
}

And yes i tried Debug.Log() and i get nothing, the problem is the function never actually runs even though i set at as the OnClick() function. @JeffDUnity3D

Nevermind, it just randomly started working without any changes being made

Could you at least try to format your code properly