
This can be accomplished by clicking under the color object (where black or another color may be selected) and choosing white. To keep with the color scheme for the game we should change the color of the text to white. Inside the text attribute, we can change the text of our pause text to “Paused”. In order to change the text of a Text object we have to click in the Inspector pane under the text attribute where the words “New Text” are.

Now we can format the Text object to have it look better within the game screen. Let’s name the newly created object PauseText. We should create a text object by right-clicking in the hierarchy pane and selecting UI -> Text. We need to create a title which tells the player that the game is paused. Let’s get started! Creating Pause Textįirst, we are going to need to create a title which tells the player that the game is paused. If it’s greater than zero, the game is un-paused (we’ll discuss this later). If the time scale is zero, the game is paused.

In Unity we are, in general, able to differentiate between a paused and un-paused game by using Time.timescale. Pause screens should only be visible when the game is paused. The completed game can be played at itch.io.Ī pause screen has a common set of controls that players are able to use to restart a level, move back to the main menu, or un-pause the game. In addition, we will also create an instructions screen so that players will be able to learn the controls they can use before they start playing the game.

Since these are some of the few elements that are required for a “finished” game, we will insert all three into our Dodger clone. Most games contain a pause menu, a game over screen, and a main menu. We will also be taking a look at how to show certain UI elements only at certain times – such as when the game is paused or when the player dies/loses. In this tutorial, we are going to take that to the next level, and allow users to pause or restart the game and switch between different scenes.

In a previous article describing how to create Dodger in Unity, we created a small button to refresh the game if a player lost. Most games have some sort of UI which makes it easier for players to switch between levels and activate certain controls (such as pausing the game or restarting a level). that can be seen when playing a game? All of that is part of what is called the User Interface (UI). What are the buttons, text, dropdowns, etc.
