Why does my unity game start paused?

I wrote this piece of code that i believe is pretty stable.

However when i go to play the game the pause menu has already popped up but its just the Canvas and Time.timeScale is still set as 1f;

Here’s my code:

public class NewBehaviourScript : MonoBehaviour
{
    public static bool Paused = false;
    public GameObject PauseMenu;

    // Start is called before the first frame update
    void Start()
    {
        Time.timeScale = 1f;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Escape))
            if (Paused)
            {
                Play();
            }
            else
                Stop();
    }

    public void Stop()
    {
        PauseMenu.SetActive(true);
        Time.timeScale = 0f;
        Paused = true;
    }

    public void MainMenu()
    {
        SceneManager.LoadScene("Rat game save screen");
    }

    public void Play()
    {
        PauseMenu.SetActive(false);
        Time.timeScale = 1f;
        Paused = false;
    }

}

Any idea why the pause menu is open when i start my game?

Please let me know because i have spent 4 hours on it already.

Try:

void Start()
{
    Play();
}

I’m pretty sure that this is the cause of your problem, you are missing proper brackets.
Since you are missing brackets the Stop() method is being called every frame in the Update method.

Also, by default your game starts at Time.timescale = 1f; so you don’t need to write it in the Start method.

Fixed code:

// Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Escape)) //I would recommend changing to GetKeyDown
            {
                        if (Paused)
                        {
                            Play();
                        }
                        else
                        {
                           Stop();
                       }
            }
    }

GetKeyUp() returns true only in one frame when the key was released, but pressed before. Play does not get called until you press and release the key.