Book Image

Getting Started with Unity 5

By : Dr. Edward Lavieri
Book Image

Getting Started with Unity 5

By: Dr. Edward Lavieri

Overview of this book

Table of Contents (15 chapters)


With the pervasiveness of games and the use of gamification in nearly every industry, the desire to discover how to use state of the art development software has never been so great. There is an increasing number of software tools available to help developers create amazing games for consoles, the Web, desktop computers, and mobile devices. Game engines are among the most powerful of these tools available. The Unity 3D game engine is one of the elite game engines. It has been used to create popular 2D and 3D games by large game studios and indie developers. With a free version available, and the release of Unity 5, the time has never been better to start using Unity.

Getting Started with Unity 5 covers one of the most popular game engines available. This book will guide you through the entire process of creating a 3D game, from downloading the Unity game engine to publishing your game. You will enjoy having complete coverage of exciting topics including player-controlled characters and animation. Whether you are just getting started as a game developer or have experience with Unity or other game engines, this book will provide you with a guided tour of developing games with Unity 5. With clear explanations, tips, and ample screenshots, you will be provided with detailed steps to develop your game.

This book takes a practice hands-on approach to learning Unity 5. As you progress through each chapter, you will build a 3D interactive game called Little Farmer Colt. As you create the game, you'll learn key features of Unity 5 including creating a game environment, animating characters, scripting, and more. All meshes, models, textures, animations, and other assets are available on the book's website.

By the time you complete the lessons in this book, you'll have full confidence to start using Unity 5 to create your own games.

What this book covers

Chapter 1, Getting Jiggy with the Unity Interface, surveys the game engine landscape, comparing other game engines with Unity to give you a full appreciation for Unity's capabilities. You'll learn how to download and install Unity 5. You'll also learn about Unity 5's user interface and core tools, including transform tools and cameras.

Chapter 2, Creating the Game Environment, will teach you about game design by reviewing the book's game design of Little Farmer Colt. You'll start creating the game environment with terrain, mountains, trees, a lake, and the sky.

Chapter 3, Working with Assets, is all about the assets used to develop games with Unity 5. You'll learn about assets, where to get them, how to make your own, and how to import them into your game. You'll also learn about free 3D object creation software to create game objects compatible with Unity 5.

Chapter 4, Animating the Game Characters, is about Unity animations and player controllers. You'll see our game characters come to life and give your users the ability to control the player.

Chapter 5, Scripting the Game, is dedicated to teaching you how to script. You'll start with a primer on C# and experience with MonoDevelop. You'll also gain experience creating your own C# scripts for your game.

Chapter 6, Adding a Graphical User Interface, contains key information on graphical user interfaces and their importance to games. You'll gain hands-on experience with the Unity 5 user interface system. You'll learn to create a heads-up display, an in-game mini-map, and full-screen navigation menus.

Chapter 7, Polishing and Optimizing the Game, will teach you several ways to make your game shine and operate optimally. You'll gain appreciation for the importance of audio and visual effects in games and how to create them. You'll gain experience with sound effects, shadows, lighting effects, and camera rendering. You'll also learn about optimizing scripts.

Chapter 8, What's Next?, is the final chapter where you'll receive several specific suggestions on how to take the Little Farmer Colt game to a higher level. You'll also learn about Unity workflow, project scalability, cross-platform issues, and the importance of attribution. You'll also gain an appreciation for advanced topics.

What you need for this book

In order to follow the examples in this book, you'll need a copy of Unity 5 or greater. This software is available for free at You can use up-to-date Windows or Mac operating systems. You'll also need an Internet connection to download the graphic assets presented in this book.

Who this book is for

This book is written for people new to Unity or that have some experience with a version prior to Unity 5. If you want to take a look at Unity 5, get a refresher, or just want to see how games can be developed with a top game engine, this book is for you.


In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "In that folder, you'll find four subfolders titled Assets, Library, ProjectSettings, and Temp."

A block of code is set as follows:

public class EatCorn : MonoBehavior {

  void Start ( ) {

  void Update ( ) {

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "You will see a Download link at the top-right section of the web page."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from:


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to and enter the name of the book in the search field. The required information will appear under the Errata section.


Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.


If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.