Book Image

Building an FPS Game with Unity

5 (1)
Book Image

Building an FPS Game with Unity

5 (1)

Overview of this book

Table of Contents (18 chapters)
Building an FPS Game with Unity
Credits
Foreword
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a main menu: part 1 – adding text


Games don't just launch straight into the gameplay. Generally they start off with some kind of Title Screen with the game's name and the option for you to play or quit. This will be a good way to get some familiarity with how the new Unity GUI system (as of Unity 4.6) works with some simple UI elements. To start off, let's add some descriptive text that will display our game's name.

  1. To start off we will need to create a new level for our main menu to exist in, so to do that go to File | New Scene.

  2. Now we could add objects into this level, but for our purposes let's make it blank. From the Hierarchy tab, select the Main Camera object, under Clear Flags select Solid Color, and then under Background change the color to black.

  3. In order to create a GUI we need to have something called a Canvas in our scene, so to do this, we need to go to GameObject | UI | Canvas.

  4. It may be hard to see the object at this point, so let's go into 2D mode. We can do that by...