Book Image

Creating E-Learning Games with Unity

By : David Horachek
Book Image

Creating E-Learning Games with Unity

By: David Horachek

Overview of this book

Table of Contents (17 chapters)
Creating E-Learning Games with Unity
About the Author
About the Reviewers


E-learning can be described as the use of computers and digital technology to facilitate teaching and learning. One popular method of accomplishing this, and which is also the approach we will take in this book, is through gamification of learning, that is, the application of cognitive psychology and game-based rules to learning systems.

At the time of writing this book, it is projected that by the year 2020, 85 percent of all daily human tasks will be gamified to some extent (Everyone is a Gamer, a HTML document by Corcione, Andrew, and Fran Tardo, available at, February 25, 2014. This document was accessed on February 28, 2014, This book was written in parts to address the need of young programmers to have a robust and substantial example of an e-learning game to learn from.

The reader will participate in the development of an e-learning game that teaches American geography, Geography Quest. The code and the book were written in tandem so that the text could serve as an accompanying guide to the software.

What this book covers

Chapter 1, Introduction to E-Learning and the Three Cs of 3D Games, introduces e-learning and how games are effective at targeting learning outcomes. It also introduces us to Unity3D and guides us through the development of the character, camera, and control systems for the game.

Chapter 2, Interactive Objects and MissionMgr, helps us to develop some of the core technology for our game foundation. We will implement a system that tracks the user's progress in the game through the concept of a mission. We also develop an interactive object class the player can interact with.

Chapter 3, Mission One – Find the Facts, helps us to code the first level of our game by applying the learning theory we know and the technology we have developed to create an exploration level.

Chapter 4, Mission One – Future Proofing the Code, helps us finish developing the first level of our game after taking a look back at our design needs and refactoring our code so that it is maintainable and extendible. This level presents the learning outcomes to the player for the first time.

Chapter 5, User Interfaces in Unity, takes a sojourn into user interface technology in Unity. We then apply our knowledge and develop a pop-up windows system that will be used in our game.

Chapter 6, NPCs and Associated Technology, helps us apply the technology we have already built in the creation of simple computer-controlled characters for our game.

Chapter 7, Mission Two – Testing a Player's Learning, guides us to develop the second level of our game, applying all of the systems and technology we have developed thus far. This level of the game gives the player an opportunity to manipulate and practice the learning outcomes.

Chapter 8, Adding Animations, takes another sojourn into the various animation systems in Unity3D. We then apply this knowledge by replacing our existing characters with 3D animated models.

Chapter 9, Synthesis of Knowledge, helps us to develop the last level of our game in this chapter by using all of the technology and theory we have learned. This level of the game challenges the user to master the desired learning outcomes.

Chapter 10, An Extensible Game Framework Pattern in Unity, integrates our game levels into one extensible framework. We will polish it more and then package the game up for your user to run on their PC.

What you need for this book

You will need Unity Version 4.2.2f1, which at the time of writing this book may be downloaded from

Who this book is for

This book is intended for beginners in Unity3D programming who wish to develop games in Unity3D that teach and inform the user of specific learning outcomes. Common target applications could be for training games that teach procedures at the workplace, for teaching policies or best practices, or for factual learning in the classroom. While some familiarity with C# and some programming concepts would be beneficial, it is not mandatory.


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: "The Hat object will serve as a visual cue for us in this chapter as we refine the controls and camera code."

A block of code is set as follows:

Public float height;
Public float desiredDistance;
Public float heightDamp;
Public float rotDamp;

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: "Under Edit | Render Settings, go to the Skybox Material panel of the Inspector pane, and add one of the skybox materials from the skybox package."


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 may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via 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 on

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 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 would 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 on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from


Piracy of copyright 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.


You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.