press space bar to start game

Hello!
I would like to start my game when I press space bar. It can’t be that complicated but I can’t find an answer anywhere! At the moment it only moves one frame each time I press space bar. I want to press space once and start the game. help is much appreciated :slight_smile:

if (Input.GetKeyDown(KeyCode.Space))

    {

        Time.timeScale = 1f;
    }

    else

    {

        Time.timeScale = 0f;
        
    }

}

I assume you run this code in Update?

Move Time.timeScale = 0f; line to Awake.

Right now each frame you are setting the scale based on whether or not user pressed the SpaceBar in that particular frame.