O'Reilly logo

Building an FPS Game with Unity by John P. Doran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a main menu: part 2 – adding buttons

We have now created the simplest type of UI there is. Let's start adding in some interactive objects with buttons that will allow us to start or close the game while also learning about Layout Groups.

  1. To start off, we will need to create a holder for the buttons we want to create to make it easy for us to add additional options to our HUD with minimal fuss. To do that we will select our Canvas object from the Hierarchy tab and then create a Panel by going to the top toolbar and selecting GameObject | UI | Panel.

    The panel object is simply an object with Rect Transform and an Image component attached that is set to take up the entire screen.

  2. Next let's create a button object. From our canvas object, select ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required