Basic In Game Pause Menu Script Problems

Good Day,

First Off, Here is the code I am having trouble with:

using System.Collections;
using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;

public class Pause : MonoBehaviour
{
public Transform canvas;
public GameObject Player;

// 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;
Player.gameObject.SetActive(false);
Cursor.visible = true;
}
else
{
canvas.gameObject.SetActive(false);
Time.timeScale = 1;
Player.gameObject.SetActive(true);
Cursor.visible = false;
}
}

}
}

The Problem I am Facing is that whenever I open the in game menu There appears to be a shadow effect (Ghosting) on my character while moving.

Is the a way to “freeze” all my character inputs Instead of needing to deactivate and reactivate, as it seems to be giving me troubles?

Kind Regards

Please use code tags.

Here is the code using code tags:

using System.Collections;
using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;

public class Pause : MonoBehaviour
{
   
    public Transform canvas;
    public GameObject Player;

    // 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;
                Player.gameObject.SetActive(false);
                Cursor.visible = true;
            }
            else
            {
                canvas.gameObject.SetActive(false);
                Time.timeScale = 1;
                Player.gameObject.SetActive(true);
                Cursor.visible = false;
            }
        }
    }
   
}