Creating the menu approach 2

As we already have a working menu, rather than removing it from our scene, we will temporarily disable the objects that make it up. By doing this, you can choose which menu you prefer later and reinstate as necessary.

Disabling Game Objects

One at a time, select the PlayBtn, the InstructionsBtn, and the QuitBtn in the Hierarchy, and deactivate them by doing the following:

  • In the Inspector, deselect the checkbox to the left of the name of the object
  • Ensure that this has turned the text of the object to light gray in the Hierarchy and that the element itself has disappeared from the Game view preview

Writing an OnGUI() script for a simple menu

Now, create a new empty object by going to GameObject | Create Empty. This makes ...

Get Unity Game Development Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.