Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Unity 5.x By Example
Unity 5.x By Example

Unity 5.x By Example: An example-based practical guide to get you up and running with Unity 5.x

eBook
€8.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Unity 5.x By Example

Chapter 1. The Coin Collection Game – Part 1

This chapter starts the first project on our list, which will be a fun collection game. Remember, it doesn't matter if you've never used Unity before. We'll go through everything necessary step by step. By the end of the next chapter, you'll have pieced together a simple, but complete and functional, game. This is an important thing to achieve because you'll get familiar with a start-to-end game development workflow. This chapter will demonstrate the following topics:

  • Game design
  • Projects and folders
  • Asset importing and configuration
  • Level design
  • Game objects
  • Hierarchies

Game design

Let's make a coin collection game. Here, the player should control a character in the first-person mode, and he must wander the level, collecting all coins before a time limit runs out. If the timer runs out, the game is lost. On the other hand, if all coins are collected before the timer expires, the game is won. The first-person controls will use the default WASD keyboard setup, where W moves forward, A and S move left and right, and D walks backward. Head movement is controlled using the mouse, and coins are collected by simply walking into them. See Figure 1.1, featuring the coin collection game in action in the Unity Editor. The great benefit in making this game is that it demonstrates all the core Unity features together, and we don't need to rely on any external software to make assets, such as textures, meshes, and materials.

Game design

Figure 1.1: Preparing for a coin collection game (the completed game)

Note

The completed CollectionGame project, as discussed in this chapter and the next, can be found in the book companion files in the Chapter01/CollectionGame folder.

Getting started – Unity and projects

Every time you want to make a new Unity game, including coin collection games, you'll need to create New Project. Generally speaking, Unity uses the term Project to mean a Game. There are two main ways to make a new project, and it really doesn't matter which one you choose because both end up in the same place. If you're already in the Unity interface, looking at an existing scene or level, you can select File | New Project from the application menu. See Figure 1.2. It may ask if you want to save changes to the currently opened project and you should choose either Yes or No, depending on what you need. After selecting the New Project option, Unity leads you to the project creation wizard:

Getting started – Unity and projects

Figure 1.2: Creating a new project via the main menu

Alternatively, if you've just started Unity for the first time, you'll probably begin at the welcome dialog. See Figure 1.3. From here, you can access the new project creation wizard by choosing the NEW PROJECT button:

Getting started – Unity and projects

Figure 1.3: The Unity welcome screen

On reaching the NEW PROJECT creation wizard, Unity can generate a new project for you on the basis of some basic settings. Simply fill in the name of your project (such as CollectionGame), and select a folder on your computer to contain the project files that will be generated automatically. Finally, click on the 3D button to indicate that we're going to create a 3D game, as opposed to 2D, and then click on the Create project button to complete the project generation process. See Figure 1.4:

Getting started – Unity and projects

Figure 1.4: Creating a new project

Projects and project folders

Unity has now created a blank, new, and empty project. This represents the starting point for any game development project and is the place where development begins. The newly created project contains nothing initially: no meshes, textures, or any other Assets. You can confirm this by simply checking the Project panel area at the bottom of the editor interface. This panel displays the complete contents of the project folder, which corresponds to an actual folder on your local drive created earlier by the project wizard. This folder should be empty. See Figure 1.5. This panel will later be populated with more items, all of which we can use to build a game.

Projects and project folders

Figure 1.5: The Unity project panel docked at the bottom of the interface

Note

If your interface looks radically different from Figure 1.5, in terms of its layout and arrangement, then you can reset the UI layout to its defaults. To do this, click on the Layout drop-down menu from the top-right corner of the editor interface, and choose Default. See Figure 1.6.

Projects and project folders

Figure 1.6: Switching to the default interface layout

You can view the contents of your project folder directly via either Windows Explorer or Mac Finder, by right-clicking the mouse in the Project panel from the Unity Editor to reveal a context menu, and from there, choose the Show in Explorer (Windows) or Reveal in Finder (Mac) option. See Figure 1.7:

Projects and project folders

Figure 1.7: Displaying the project folder via the Project panel

Clicking on Show in Explorer displays the folder contents in the default system file browser. See Figure 1.8. This view is useful to inspect files, count them, or back them up. However, don't change the folder contents manually this way via Explorer or Finder. Specifically, don't move, rename, or delete files from here, because doing so can corrupt your Unity project irretrievably. Instead, delete and move files where needed within the Project panel in the Unity Editor. This way, Unity updates its metadata as appropriate, ensuring that your project continues to work properly.

Projects and project folders

Figure 1.8: Viewing the Project panel from the OS file browser

Note

Viewing the project folder in the OS file browser will display additional files and folders not visible in the Project panel, such as Library and ProjectSettings, and maybe a Temp folder. Together, these are known as the project metadata. This is not directly a part of your project per se, but contains additional settings and preferences that Unity needs to work properly. These folders and their files should not be edited or changed.

Importing assets

Assets are the raw materials for games—the building blocks from which they're made. Assets include meshes (or 3D models), such as characters, props, trees, houses, and more: textures, which are image files such as JPEGs and PNGs (these determine how the surface of a mesh should look); music and sound effects to enhance the realism and atmosphere of your game, and finally, scenes, which are 3D spaces or worlds where meshes, textures, sounds, and music live, exist, and work together holistically as part of a single system. Thus, games cannot exist without assets—they would otherwise look completely empty and lifeless. For this reason, we'll need assets to make the coin collection game we're working toward. After all, we'll need an environment to walk around and coins to collect!

Unity, however, is a game engine and not an asset creation program. This means that assets, such as characters and props, are typically made first by artists in external, third-party software. From here, they are exported and transferred ready-made to Unity, and Unity is responsible only for bringing these assets to life in a coherent game that can be played. Third-party asset creation programs include Blender (which is free of charge), Maya or 3DS Max to make 3D models, Photoshop or GIMP (which is free of charge) to create textures, and Audacity (which is free of cost) to generate audio. There are plenty of other options too. The details of these programs are beyond the scope of this book. In any case, Unity assumes that you already have assets ready to import to build a game. For the coin collection game, we'll use assets that ship with Unity. So let's import these to our project. To do this, select Assets | Import Package from the application menu. Then select Characters, ParticleSystems, Environment, and Prototyping. See Figure 1.9:

Importing assets

Figure 1.9: Importing assets via the Import Package menu

Each time you import a package from the menu, you'll be presented with an Import dialog. Simply leave all settings at their defaults, and click on Import. See Figure 1.10:

Importing assets

Figure 1.10: Choosing Assets to import

By default, Unity decompresses all files from the package (a library of assets) into the current project. After importing, lots of different assets and data will have been added to the Project, ready for use. These files are copies of the originals. So any changes made to the imported files will not affect or invalidate the originals, which Unity maintains internally. The files include models, sounds, textures, and more. These are listed in the Unity Editor from the Project panel. See the following screenshot:

Importing assets

Figure 1.11: Browsing imported assets from the Project panel

Tip

When selecting Assets | Import from the application menu, if you don't see all, or any, asset packages listed, you can download and install them separately from the Unity website at https://unity3d.com/. From the downloads page, choose the Additional Downloads option, and then select the Standard Assets package. See Figure 1.12.

Importing assets

Figure 1.12: Downloading the Standard Assets package

The imported assets don't exist yet in our game. They don't appear on screen, and they won't do anything yet! Rather, they're simply added to the Project panel, which behaves as a library or repository of assets, from which we can pick and choose to build up a game. The assets imported thus far are built-in into Unity and we'll be continually using them in subsequent sections to make a functional coin collection game. To get more information about each asset, you can select the asset by clicking on it with the mouse, and asset-specific details will be shown on the right-hand side of the Unity Editor in the Inspector. The Inspector is a property sheet editor that appears on the right-hand side of the interface. It is context-sensitive and always changes to display properties for the selected object. See Figure 1.13.

Importing assets

Figure 1.13: The Inspector displays all the properties for the currently selected object

Starting a level

We've now created a Unity project and imported a large library of assets via the Unity Standard Asset package, including architectural meshes for walls, floors, ceilings, and stairs. This means that we're now ready to build our first level using these assets! Remember, in Unity, a scene means a level. The word scene and level can be used interchangeably here. They refer simply to a 3D space, that is, the space-time of the game world—the place where things exist. Since all games happen in space and time, we'll need a scene for the coin collection game. To create a new scene, select File | New Scene from the application menu, or press Ctrl + N on the keyboard. When you do this, a new and empty scene is created. You can see a visualization or preview of the scene via the Scene tab, which occupies the largest part of the Unity interface. See Figure 1.14.

Starting a level

Figure 1.14: The Scene tab displays a preview of a 3D world

Tip

As shown in Figure 1.14, other tabs besides the scene are visible and available in Unity. These include a Game tab and an Animator tab; in some cases, there could be more as well. For now, we can ignore all the tabs except Scene. The Scene tab is designed for quick and easy previewing of a level during its construction.

Each new scene begins empty; well, almost empty. By default, each new scene begins with two objects. Specifically, a Light to illuminate any other objects that are added, and a Camera to display and render the contents of the scene from a specific vantage point. You can view a complete list of all the objects existing in the scene using the Hierarchy panel, which is docked to the left-hand side of the Unity interface. See Figure 1.15. This panel displays the name of every GameObject in the scene. In Unity, the word GameObject simply refers to a single, independent, and unique thing that lives within the scene, whether visible or not: meshes, lights, cameras, props, and more. Thus, the Hierarchy panel tells us about everything in the Scene.

Starting a level

Figure 1.15: The Hierarchy panel

Tip

You can even select objects in the scene by clicking on their name in the Hierarchy panel.

Next, let's add a floor to the scene. After all, the player needs something to stand on! We could build a floor mesh from scratch using third-party modeling software such as Maya, 3DS Max, or Blender. However, the Unity Standard Asset package, which was imported earlier, contains floor meshes that we can use. This is very convenient. These meshes are part of the Prototyping package. To access them via the Project panel, open the Standard Assets folder by double-clicking it, and then access the Prototyping | Prefabs folder. From here, you can select objects and preview them from the Inspector. See Figure 1.16.

Tip

You could also quickly add a floor to the scene by choosing GameObject | 3D Object | Plane from the application menu. However, this just adds a dull, grey floor, which isn't very interesting. Of course, you could change its appearance. As we'll see later, Unity lets you do this. However, for this tutorial, we'll use a specifically modeled floor mesh via the Standard Assets package from the Project panel.

Starting a level

Figure 1.16: The Standard Assets/Prototyping package contains many meshes for quick scene building

The mesh named FloorPrototype64x01x64 (as shown in Figure 1.16) is suitable as a floor. To add this mesh to the scene, simply drag and drop the object from the Project panel to the Scene view and then release the mouse. See Figure 1.17. When you do this, notice how the Scene view changes to display the newly added mesh within the 3D space, and the mesh name also appears as a listing in the Hierarchy panel:

Starting a level

Figure 1.17: Dragging and dropping mesh assets from the Project panel to the Scene view will add them to the scene

The floor mesh asset from the Project panel has now been instantiated as a GameObject in the scene. This means that a copy or clone of the mesh asset, based on the original in the Project panel, has been added to the scene as a separate GameObject. The Instance (or GameObject) of the floor in the scene still depends on the floor asset in the Project panel. However, the asset does not depend on the instance. This means that by deleting the floor in the scene, you will not delete the asset. However, if you delete the asset, you will invalidate the GameObject. You can also create more floors in Scene if you want by dragging and dropping the floor asset many times from the Project panel to the Scene view. Each time, a new instance of the floor is created in the Scene as a separate and unique GameObject, although all the added instances will still depend on the single floor asset in the Project panel. See Figure 1.18:

Starting a level

Figure 1.18: Adding multiple instances of the floor mesh to the scene

We don't actually need the duplicate floor pieces, however. So let's delete them. Just click on the duplicates in the Scene view and then press Delete on the keyboard to remove them. Remember, you can also select and delete objects by clicking on their name in the Hierarchy panel and pressing Delete. Either way, this leaves us with a single floor piece and a solid start to building our scene. One remaining problem, though, concerns the floor and its name. By looking carefully in the Hierarchy panel, we can see that the floor name is FloorPrototype64x01x64. This name is long, obtuse, and unwieldy. We should change it to something more manageable and meaningful. This is not technically essential but is good practice to keep our work clean and organized. There are many ways to rename an object. One way is to first select it and then enter a new name in the name field in the Object Inspector. I'll rename it WorldFloor. See Figure 1.19:

Starting a level

Figure 1.19: Renaming the floor mesh

Transformations and navigation

A scene with a floor mesh has been established, but this alone is uninteresting. We need to add more, such as buildings, stairs, columns, and perhaps more floor pieces. Otherwise, there would be no world for the player to explore. Before building on what we've got, however, let's make sure that the existing floor piece is centered at the world origin. Every point and location within a scene is uniquely identified by a coordinate, measured as an (X, Y, Z) offset from the world center (origin). The current position for the selected object is always visible from the Object Inspector. In fact, the Position, Rotation, and Scale of an object are grouped together under a category (component) called Transform. Position indicates how far an object should be moved in three axes from the world center. Rotation indicates how much an object should be turned or rotated around its central axes. Scale indicates how much an object should be shrunk or expanded to smaller or larger sizes. A default Scale of one means that an object should appear at normal size, two means twice the size, and 0.5 means half the size, and so on. Together, the Position, Rotation and Scale of an object constitute its transformation. To change the position of the selected object, you can simply type new values in the X, Y, and Z fields for Position. To move an object to the world center, simply enter (0, 0, and 0), as shown in Figure 1.20:

Transformations and navigation

Figure 1.20: Centering an object to the world origin

Setting the position of an object, as we've done here, by typing numerical values is acceptable and appropriate for the specifying of exact positions. However, it's often more intuitive to move objects using mouse-based controls. To do this, let's add a second floor piece and position it away from the first instance. Drag and drop a floor piece from the Project panel in Scene to create a second floor GameObject. Then click on the new floor piece to select it and switch to the Translate tool. To do this, press W on the keyboard or click on the translate tool icon from the toolbar at the top of the editor interface. The translate tool allows you to reposition objects in Scene. See Figure 1.21:

Transformations and navigation

Figure 1.21: Accessing the translate tool

When the translate tool is active and an object is selected, a Gizmo appears centered on the object (three colored axes visible in the Scene tab). The translate Gizmo appears as three colored perpendicular axes: red, green, and blue corresponding to X, Y, and Z respectively. To move an object, hover your cursor over one of the three axes (or planes between axes), and then click and hold the mouse while moving it to slide the object in that direction. You can repeat this process as often as needed to ensure that your objects are positioned where you need them to be. Use the translate tool to move the second floor piece away from the first. See Figure 1.22:

Transformations and navigation

Figure 1.22: Translate an object using the translate Gizmo

You can also rotate and scale objects using the mouse, as with translate. Press E to access the rotate tool or R to access the scale tool, or you can activate these tools using their respective toolbar icons from the top of the editor. When these tools are activated, a Gizmo appears centered on the object, and you can click and drag the mouse over each specific axis to rotate or scale objects as needed. See Figure 1.23:

Transformations and navigation

Figure 1.23: Accessing the rotate and scale tools

Being able to translate, rotate, and scale objects quickly through mouse and keyboard combinations is very important when working in Unity. For this reason, make using the keyboard shortcuts a habit as opposed to accessing the tools continually from the toolbar. However, in addition to moving, rotating, and scaling objects, you'll frequently need to move around yourself in the Scene view in order to see the world from different positions, angles, and perspectives. This means that you'll frequently need to reposition the scene preview camera in the world. You'll want to zoom in and zoom out of the world to get a better view of objects and change your viewing angle to see how objects align and fit together properly. To do this, you'll need to make extensive use of both the keyboard and mouse together.

To zoom closer or further from the object you're looking at, simply scroll the mouse wheel up or down—up zooms in and down zooms out. See Figure 1.24:

Transformations and navigation

Figure 1.24: Zooming in and out

To pan the Scene view left or right, or up or down, hold down the middle mouse button while moving the mouse in the appropriate direction. Alternatively, you can access the pan tool from the application toolbar (or press Q on the keyboard) and then simply click and drag in the Scene view while the tool is active. Pan does not zoom in or out; it simply slides the camera left and right, or up and down.

Transformations and navigation

Figure 1.25: Accessing the Pan tool

Sometimes, while building levels, you'll lose sight entirely of the object that you need. For example, your viewport camera could be focusing on a completely different place from the object you really want to click or see. In this case, you'll often want to shift the viewport camera automatically in order to focus on that specific object. Specifically, you'll want to reposition and rotate the viewport as necessary to bring a desired object to the center of the view. To do this automatically, select the object to focus on (or frame) by clicking on its name from the Hierarchy panel. Then, press the F key on the keyboard. Alternatively, you can double-click its name in the Hierarchy panel. See Figure 1.26:

Transformations and navigation

Figure 1.26: Framing a selected object

After framing an object, you'll often want to rotate around it in order to quickly and easily view it from all important angles. To achieve this, hold down the Alt key on the keyboard while clicking and dragging the mouse to rotate the view. See Figure 1.27:

Transformations and navigation

Figure 1.27: Rotating around the framed object

Lastly, it's helpful to navigate a level in the Scene view using first-person controls, that is, controls that mimic how first-person games are played. This helps you experience the scene at a more personal and immersive level. To do this, hold down the right mouse button and (with the button depressed) use the WASD keys on the keyboard to control forward, backward, and strafing movement. Movement of the mouse controls head orientation. You can also hold down the Shift key while moving to increase movement speed. See Figure 1.28:

Transformations and navigation

Figure 1.28: Using first-person controls

The great thing about learning the versatile transformation and navigation controls is that, on understanding them, you can move and orient practically any object in any way, and you can move and view the world from almost any position and angle. Being able to do this is critically important to build quality levels quickly. All of these controls, along with some others that we'll soon see, will be used frequently throughout this book to create scenes and work in Unity generally.

Scene building

Now that we've seen how to transform objects and navigate the scene viewport successfully, let's proceed to complete our first level for the coin collection game. Let's separate the two floor meshes apart in space, leaving a gap between them that we'll fix by creating a bridge, which the player will be able to cross, moving between the floor spaces like islands. We can use the translate tool (W) to move objects around. See Figure 1.29:

Scene building

Figure 1.29: Separating the floor meshes into islands

Tip

If you want to create more floor objects, you can use the method that we've seen already by dragging and dropping the mesh asset in the Project panel in the Scene viewport. Alternatively, you can duplicate the selected object in the viewport by pressing Ctrl + D on the keyboard. Both methods produce the same result.

Next, we'll add some props and obstacles to the scene. Drag and drop some house objects onto the floor. The house object (HousePrototype16x16x24) is found in the Assets | Standard Assets | Prototyping | Prefabs folder. See Figure 1.30:

Scene building

Figure 1.30: Adding house props to the scene

On dragging and dropping the house in the scene, it may align to the floor nicely with the bottom against the floor, or it may not align like that. If it does, that's splendid and great luck! However, we shouldn't rely on luck every time because we're professional game developers! Thankfully, we can make any two mesh objects align easily in Unity using vertex snapping. This feature works by forcing two objects into positional alignment within the scene by overlapping their vertices at a specific and common point.

For example, consider Figure 1.31. Here, a house object hovers awkwardly above the floor and we naturally want it to align level with the floor and perhaps over to the floor corner. To achieve this, start by selecting the house object (click on it or select it from the Hierarchy panel). The object to be selected is the one that should move to align and not the destination (which is the floor), which should remain in place.

Scene building

Figure 1.31: Misaligned objects can be snapped into place with Vertex Snapping

Next, activate the translate tool (W) and hold down the V key for vertex snapping. With V held down, move the cursor around and see how the Gizmo cursor sticks to the nearest vertex of the selected mesh. See Figure 1.32. Unity is asking you to pick a source vertex for the snapping:

Scene building

Figure 1.32: Hold down V to activate Vertex Snapping

With V held down, move the cursor to the bottom corner of the house, and then click and drag from the corner to the floor mesh corner. The house will then snap align to the floor, corner to corner. When aligned this way, it release the V key, and the two meshes get aligned exactly at the vertices. See Figure 1.33:

Scene building

Figure 1.33: Align two meshes by vertices

Now you can assemble a complete scene using the mesh assets included in the Prototyping package. Drag and drop props in the scene, and using translate, rotate, and scale, you can reposition, realign, and rotate these objects; using vertex snapping, you can align them wherever you need. Give this some practice. See Figure 1.34 for the scene arrangement that I made using only these tools and assets:

Scene building

Figure 1.34: Building a complete level

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • The most updated resource on Unity 5.x with comprehensive discussion on all the new features of Unity 5.x
  • Understand the core concepts surrounding Unity5 game development with this power-packed hands-on guide
  • Brush up your existing game development skills and create games that have a brilliant gameplay using the excellent examples from this book

Description

Unity is an exciting and popular engine in the game industry. Throughout this book, you’ll learn how to use Unity by making four fun game projects, from shooters and platformers to exploration and adventure games. Unity 5 By Example is an easy-to-follow guide for quickly learning how to use Unity in practical context, step by step, by making real-world game projects. Even if you have no previous experience of Unity, this book will help you understand the toolset in depth. You'll learn how to create a time-critical collection game, a twin-stick space shooter, a platformer, and an action-fest game with intelligent enemies. In clear and accessible prose, this book will present you with step-by-step tutorials for making four interesting games in Unity 5 and explain all the fundamental concepts along the way. Starting from the ground up and moving toward an intermediate level, this book will help you establish a strong foundation in making games with Unity 5.

Who is this book for?

The ideal target audience for this book would be game developers. They need not have previous experience with Unity since this book will cover all the basics about game development with unity. This would also be a very good resource for Unity developers who want to brush up their basic Unity skills and also get up and running with creating interesting games with Unity 5.x.

What you will learn

  • Understand core Unity concepts, such as game objects, components, and scenes
  • Learn level design techniques for building immersive and interesting worlds
  • Learn to make functional games with C# scripting
  • Use the toolset creatively to build games of different themes and styles
  • Learn to handle player controls and input functionality
  • Dive into the process of working with terrains and world-creation tools
  • Import custom content into Unity from third-party tools, such as Maya and Blender
  • Get to grips with making both 2D and 3D games

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 23, 2016
Length: 402 pages
Edition : 1st
Language : English
ISBN-13 : 9781785888120
Vendor :
Unity Technologies
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Mar 23, 2016
Length: 402 pages
Edition : 1st
Language : English
ISBN-13 : 9781785888120
Vendor :
Unity Technologies
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 124.97
Unity 5.x By Example
€41.99
Unity 5.x Cookbook
€45.99
Learning C# by Developing Games with Unity 5.x
€36.99
Total 124.97 Stars icon
Banner background image

Table of Contents

9 Chapters
1. The Coin Collection Game – Part 1 Chevron down icon Chevron up icon
2. Project A – the Collection Game Continued Chevron down icon Chevron up icon
3. Project B – the Space Shooter Chevron down icon Chevron up icon
4. Continuing the Space Shooter Chevron down icon Chevron up icon
5. Project C – a 2D Adventure Chevron down icon Chevron up icon
6. Continuing the 2D Adventure Chevron down icon Chevron up icon
7. Project D – Intelligent Enemies Chevron down icon Chevron up icon
8. Continuing with Intelligent Enemies Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.7
(7 Ratings)
5 star 42.9%
4 star 14.3%
3 star 14.3%
2 star 28.6%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




HLC Sep 11, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good Introduction to Unity. This basically gives all the tools required to make your first basic games with minimal programming involved.
Amazon Verified review Amazon
Hugo Apr 23, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book teach how to build 3 complete and very different games on Unity 5.x from scratch, you will learn how to create the base of each project, how to proceed and create each feature, how to work in Unity editor using some features in a real project. The last two chapters teach how to create a more advanced game, by building a 3D terrain using terrain tools in Unity, a player that can explore and enemy's with AI that follows the player, this will apply most of the techniques showed in the previous chapters and also will able you to use your creativity to create gaming conditions, to finish this game, creating levels, more types of enemy's, the sky is the limit. I think book is for people that already know the basics of Unity and know how to code, more specifically in C#, but doesn't know about game development, but on the other hand, I think that everyone could take this book, even if you know nothing about game development in general but want to learn, or if you are already a game developer, because it will teach you very different techniques of game development, both 2D and 3D, the games are in an interesting scale of complexity, as you learn how to use the power's of Unity and after reading this book you become much more confident in game development, you will be prepared to start almost any kind of project, my suggestion is for start implementing more levels and features in book examples. This book helped me to learn more deeply Unity and I would suggest for my friends who like to create games, Unity is a good choice to start building games and this book is for sure an amazing guide to create complete games. The author know how to write and teach game development in Unity, if you search his name, you will see that he already has made some great games, write some good books and video courses.
Amazon Verified review Amazon
Amit Kumar Oct 07, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This Book is good for Beginners who wanna learn Game Designing from Starting
Amazon Verified review Amazon
Xa4 Apr 18, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Edit: the author just gave a link to the files in his twitter account ( @thorn_alan ) while we wait for the publisher to finally solve the issue. I've changed my rating accordingly, but it's only based on the first chapters so take the recoomendation with a grain of salt.The book is clear and well written, based on the first chapters. Unfortunately, later chapters require companion files to follow them, and one month after the book's release, they still aren't available on the book's website.I'll change my review when this problem is corrected, but in the meantime, you should delay your purchase.
Amazon Verified review Amazon
KeaganRiley Aug 10, 2020
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
I'm new to game dev but had no issues learning until the book gets to coding its scoring system for the first game. It uses Mono Develop, which I found to be a pain to try and install successfully and just plain not worth it. I tried continuing anyway and just using Visual Studio Code instead but the book's code was not compatible and I'm not experienced enough to properly adapt it. Wouldn't recommend it to beginners unless you're skilled enough in C# to problem solve the code.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.