VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/menus-start-pause-game-over-in-unity/

⇱ Menus (Start, Pause, Game Over) In Unity - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Menus (Start, Pause, Game Over) In Unity

Last Updated : 4 May, 2026

Menus are the bridge between the player and your game. A start menu welcomes the player, a pause menu gives control during gameplay and a game over menu provides closure. This article covers creating all three.

Game Menus

Menus are UI screens that appear at different times during gameplay.

  • Start Menu: First screen player sees. Has Play, Options, Quit buttons.
  • Pause Menu: Appears when player presses Escape. Has Resume, Restart, Main Menu buttons.
  • Game Over Menu: Appears when player dies or completes game. Shows final score and Restart button.
👁 Game-Menus-In-Unity
Game Menus In Unity

Start Menu Script

This script handles buttons on the main menu screen.

Output:

👁 Start-Menu-In-Unity
Start Menu In Unity

SceneManager.LoadScene() loads the game scene. Application.Quit() closes the game (works only in built game, not in Editor).

Pause Menu Script

Pause menu appears when player presses Escape during gameplay.

Output:

👁 Pause-Menu-In-Unity
Pause Menu In Unity

Press Escape to toggle pause. Cursor.lockState controls mouse visibility – useful for first-person games where cursor should be hidden.

Game Over Menu Script

Game over screen appears when player dies. It shows final score and options to replay.

Call ShowGameOver() from your player's health script when health reaches zero. The final score displays before restart options.

Comment
Article Tags:
Article Tags:

Explore