C# problem with pause menu

First of all my english is bad so sorry my mistakes writting. I’m trying to make work a pause menu which use canvas and timescale works, but if I press the movement keycodes the object still moving so i decided if the timescale = 0 disable the scrip of the object but i had a lot of issues and i can’t find a solution so anyone could help me? this is my pause script:
public class pause : MonoBehaviour {
public Transform canvas;

// Use this for initialization
void Start () {
	
}
		
// Update is called once per frame
void Update () 
{
	if(Input.GetKeyDown (KeyCode.Escape)) 
	{
		if (canvas.gameObject.activeInHierarchy == false) {
			canvas.gameObject.SetActive (true);
			Time.timeScale = 0;
			if (canvas.gameObject.SetActive (true)) 
			{
				GetComponent<Group> ().enabled =(false);
			}

		} 
	}

}
public void Return()
{
	canvas.gameObject.SetActive (false);
	Time.timeScale = 1;
	if (canvas.gameObject.SetActive (false)) 
	{
		GetComponent<Group> ().enabled =(true);
	}

}
public void Exit()
{
	SceneManager.LoadScene ("MainMenu");
}

You can set the time scale to 0.00001f or make your UI scripts independends from the time scale by using custom time (you can find it on this forum).

Try this maybe

Don’t know if how you did it in your hiearchy, but you should put all your pause stuff in a panel

`
public class Pause : MonoBehaviour 
{
    [SerializeField] private GameObject pausePanel;
    

    void Start()
    {
        pausePanel.SetActive(false);
    }
    

    void Update()
    {
        if(Input.GetKeyDown (KeyCode.Escape)) 
        {
            if (canvas.gameObject.activeInHierarchy == false) 
            {
                PauseGame();
            }
            if (canvas.gameObject.SetActive (true)) 
            {
                 ContinueGame();   
            }
        } 
     }
    

    private void PauseGame()
    {
        Time.timeScale = 0;
        pausePanel.SetActive(true);
        /DisableControllers
    } 
    

    private void ContinueGame()
    {
        Time.timeScale = 1;
        pausePanel.SetActive(false);
        /EnableControllers
    }
}
`

Also, did you make an empty object called GameController where you put the pause script on?
it’s not required, but very helpfull

Good luck