Unity Game Development Essentials


Unity Game Development Essentials
eBook: $29.99
Formats: PDF, PacktLib, ePub and Mobi formats
$25.49
save 15%!
Print + free eBook + free PacktLib access to the book: $79.98    Print cover: $49.99
$49.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Reviews
Support
Sample Chapters
  • Kick start game development, and build ready-to-play 3D games with ease
  • Understand key concepts in game design including scripting, physics, instantiation, particle effects, and more
  • Test & optimize your game to perfection with essential tips-and-tricks
  • Written in clear, plain English, this book is packed with working examples and innovative ideas
  • This book is based on Unity version 2.5 and uses JavaScript for scripting

Book Details

Language : English
Paperback : 316 pages [ 235mm x 191mm ]
Release Date : October 2009
ISBN : 184719818X
ISBN 13 : 9781847198181
Author(s) : Will Goldstone
Topics and Technologies : All Books, Game Development, Unity, Games

Back to BOOK PAGE

Table of Contents

Preface
Chapter 1: Welcome to the Third Dimension
Chapter 2: Environments
Chapter 3: Player Characters
Chapter 4: Interactions
Chapter 5: Prefabs, Collection, and HUD
Chapter 6: Instantiation and Rigid Bodies
Chapter 7: Particle Systems
Chapter 8: Menu Design
Chapter 9: Finishing Touches
Chapter 10: Building and Sharing
Chapter 11: Testing and Further Study
Index
  • Chapter 1: Welcome to the Third Dimension
    • Getting to grips with 3D
      • Coordinates
      • Local space versus World space
      • Vectors
      • Cameras
      • Polygons, edges, vertices, and meshes
      • Materials, textures, and shaders
      • Rigid Body physics
      • Collision detection
    • Essential Unity concepts
      • The Unity way
        • Assets
        • Scenes
        • Game Objects
        • Components
        • Scripts
        • Prefabs
    • The interface
      • The Scene window and Hierarchy
      • The Inspector
      • The Project window
      • The Game window
    • Summary
  • Your first Unity project
  • Using the terrain editor
    • Terrain menu features
      • Importing and exporting heightmaps
      • Set Heightmap resolution
      • Creating the lightmap
      • Mass Place Trees
      • Flatten Heightmap
      • Refresh Tree and Detail Prototypes
    • The terrain toolset
      • Terrain Script
      • Raise Height
      • Paint height
      • Smooth height
      • Paint Texture
      • Place Trees
      • Paint Details
      • Terrain Settings
    • Sun, Sea, Sand—creating the island
    • Take Me Home! Introducing models
      • Importing the model package
      • Common settings for models
      • Setting up the outpost model
  • Summary
  • Chapter 3: Player Characters
    • Working with the Inspector
      • Tags
      • Layers
      • Prefabs and the Inspector
    • Deconstructing the First Person Controller object
      • Parent-child issues
      • First Person Controller objects
        • Object 1: First Person Controller (parent)
        • Object 2: Graphics
        • Object 3: Main Camera
    • Scripting basics
      • Commands
      • Variables
      • Functions
      • If else statements
      • Globals and dot syntax
      • Comments
      • Further reading
  • The FPSWalker script
    • Launching the script
    • Deconstructing the script
  • Summary
  • Adding the outpost
    • Positioning
    • Scaling
    • Colliders and tagging the door
    • Disabling automatic animation
  • Opening the outpost
    • Approach 1—Collision detection
      • Creating new assets
      • Scripting for character collision detection
      • Attaching the script
    • Approach 2—Ray casting
      • Disabling collision detection—using comments
      • Resetting the door collider
      • Adding the ray
  • Summary
  • Chapter 5: Prefabs, Collection, and HUD
    • Creating the battery prefab
      • Download, import, and place
      • Tagging the battery
      • Scale, collider, and rotation
        • Enlarging the battery
        • Adding a trigger collider
        • Creating a rotation effect
        • Saving as a prefab
    • Scattering batteries
    • Displaying the battery GUI
      • Creating the GUI Texture object
      • Positioning the GUI Texture
      • Scripting for GUI change
    • Battery collection with triggers
    • Restricting outpost access
      • Restricting access
        • Utilizing GetComponent()
      • Hints for the player
        • Battery GUI hint
        • GUI Text hint
        • Using fonts
    • Summary
  • Chapter 6: Instantiation and Rigid Bodies
    • Introducing instantiation
      • In concept
      • In code
        • Passing in an object
        • Position and rotation
    • Introducing rigid bodies
      • Forces
      • The Rigidbody component
    • Making the minigame
      • Creating the coconut prefab
        • Creating the textured coconut
        • Adding physics
        • Saving as a prefab
      • Creating the Launcher object
      • Scripting coconut throws
        • Checking for player input
        • Playing feedback sound
        • Instantiating the coconut
        • Naming instances
        • Assigning velocity
        • Safeguarding collisions
      • Script and variable assignment
      • Instantiate restriction and object tidying
        • Activating coconut throw
        • Removing coconuts
      • Adding the coconut shy platform
        • Import settings
        • Placement
        • Coconut detection script
        • Script assignment
        • Making more targets
      • Winning the game
        • Variable setup
        • Checking for a win
        • Script assignment
        • Incrementing and decrementing targets
      • Finishing touches
        • Adding the crosshair
        • Informing the player
    • Summary
  • Chapter 7: Particle Systems
    • What is a particle system?
      • Particle emitter
      • Particle Animator
      • Particle Renderer
        • In summary
    • Making the task
      • Asset download
      • Adding the log pile
      • Creating the fire particle systems
        • Making fire
        • Making smoke
        • Adding audio to the fire
      • Lighting the fire
        • Adding the matches
        • Creating the Matches GUI
        • Collecting the matches
        • Setting fire
    • Testing and confirming
    • Summary
  • Chapter 8: Menu Design
    • Interfaces and menus
      • Making the main menu
        • Creating the scene
        • Cancelling mip mapping
        • Adding titling
    • Creating the menu—approach 1
      • Adding the play button
        • GUI Texture button script
        • Assigning public member variables
        • Adding the instructions button
        • Adding the quit button
        • Using debug commands to check scripts
    • Creating the menu—approach 2
      • Disabling Game Objects
      • Writing an OnGUI() script for a simple menu
        • Fixed versus layout
        • Public member variables
        • The OnGUI() function
        • Flexible positioning for GUIs
        • Adding UnityGUI buttons
        • Opening scenes with custom functions
        • GUI skin settings
      • Decision time
    • Summary
  • Chapter 9: Finishing Touches
    • Volcano!
      • Positioning the particle system
      • Downloading assets
      • Making the smoke material
      • Particle system settings
        • Ellipsoid Particle Emitter settings
        • Particle Animator settings
      • Adding audio to the volcano
      • Volcano testing
    • Coconut trails
      • Editing the Prefab
      • Trail Renderer component
      • Updating the prefab
    • Performance tweaks
      • Camera Clip Planes and fog
      • Ambient lighting
    • Instructions scene
      • Adding screen text
      • Text Animation using Linear Interpolation (Lerp)
      • Menu return
    • Island level fade-in
      • UnityGUI texture rendering
    • Game win notification
    • Summary
  • Chapter 10: Building and Sharing
    • Build Settings
      • Web Player
        • Player Settings
      • Web Player Streamed
      • OS X Dashboard Widget
      • OS X/Windows Standalone
    • Building the game
      • Adapting for web build
      • Texture compression and debug stripping
      • Building standalone
        • Indie versus Pro
      • Building for the Web
        • Adapting web player builds
    • Quality Settings
    • Player Input settings
    • Sharing your work
    • Summary
  • Chapter 11: Testing and Further Study
    • Testing and finalizing
      • Public testing
        • Frame rate feedback
        • Boosting performance
    • Approaches to learning
      • Cover as many bases as possible
      • If you don't know, just ask!
    • Summary
Back to BOOK PAGE

Will Goldstone

Will Goldstone is a longstanding member of the Unity community and works for Unity Technologies as a Technical Support Associate, handling educational content and developer support. With an MA in Creative Education, and many years experience as a lecturer in higher education, Will wrote the first ever Unity book, the original Unity Game Development Essentials, and also created the first ever video tutorials for the package. Through his sites http://www.unity3dstudent.com and http://learnunity3d.com Will helps to introduce new users to the growing community of developers discovering Unity every day.

Code Downloads

Download the code and support files for this book.


Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


Errata

- 17 submitted: last submission 29 Oct 2013

Errata type: technical | Page number: 37

Under "Step 2—Island outline": "Select the first brush in the palette, and set its Brush Size to 75. Set Opacity for the brush to 0.5." should be "Select the first brush in the palette, and set its Brush Size to 75. Set Opacity for the brush to 50."

 

Errata type: Technical | Page number: 39

Under "Step 3—Volcano!": "Choose the first brush in the palette, and set the Brush Size to 75, Opacity to 0.5. and Height to 200." should be "Choose the first brush in the palette, and set the Brush Size to 75, Opacity to 50. and Height to 200."

 

Errata type: Technical | Page number: 45

Under "Sandy areas": "Set the Brush Size to 60, Opacity to 0.5, and Target Strength to 1." should be "Set the Brush Size to 60, Opacity to 50, and Target Strength to 1."

 

Errata type: Technical | Page number: 46

Under "Grass & Rock": "Next select the Grass & Rock texture by clicking on the second thumbnail added. Set the Brush Size to 25, Opacity to 0.3, and Target Strength to 0.5." should be "Next select the Grass & Rock texture by clicking on the second thumbnail added. Set the Brush Size to 25, Opacity to 30, and Target Strength to 50.

 

Errata type: Technical | Page number: 48

"Set Color Variation to 0.4 to give us a varied set of trees and Tree Height / Width to 1.5 with their Variation settings to 0.3." should be "Set Color Variation to 40 to give us a varied set of trees and Tree Height / Width to 150 with their Variation settings to 30."

 

Errata type: URL | Page number: 53

"www.packtpub.com/files/8181_Code.zip" should be "www.packtpub.com/files/code/8181_Code.zip"

 

Errata type: Grammar | Page number: 87

Under "Multiple Conditions": "carry out our instructions if the variable's values are as specified." should be "carry out our instructions if the variables' values are as specified."

 

Errata type: Code | Page number: 115

"doorOpen = true;" should be "doorIsOpen = true"

 

Errata type: Code | Page number: 126

Door(doorOpenSound, true, "dooropen"); should be Door(doorOpenSound, true, "dooropen", currentDoor);

 

Errata type: Others | Page number: 201

Last paragraph ,after this "Go to File | Save in the script editor now and switch back to Unity." Following should be added "Select the First Person Controller object in the Hierarchy so that you can see the PlayerCollisions script in the list of components in the Inspector. You will now notice that there is an additional public member variable called matchGUI which needs a game object assigning to it. Drag and drop the MatchGUIprefab asset from the Fire Feature folder in the Project panel to this variable slot to assign it."

 

Errata type: Grammar | Page number: 210

Remove comma after Daylight on the third bullet-point. It should be "In the Hierarchy panel, drag-and-drop the Directional Light, Daylight Simple Water, and Terrain objects onto the Environment empty object. Now we are ready to duplicate this level to create our menu in a separate scene."

 

Errata type: Others | Page number: 45

 

The line "to step back one brush stroke, that is, a single-0.held mouse click" should be "to step back one brush stroke, that is, a single-held mouse click."

 

Errata type: Code | Page number: 201

var matchGUIobj = Instantiate(matchGUI, Vector3(0.15,0.1,0), transform.rotation); matchGUIobj.name = matchGUI;
should be:
var matchGUIobj : GameObject = Instantiate(matchGUI, Vector3(0.15,0.1,0), transform.rotation); matchGUIobj.name = "matchGUI";

 

Errata type: Others | Page number: 166

Screenshot should show text 'None (Rigidbody)' to the right of 'Coconut Object'.

 

Errata type: Code | Page number: 153

Instantiate(myPrefab,Vector3(0,12,30),Vector3(0,0,90));
should be:
Instantiate(myPrefab,Vector3(0,12,30),Quaternion.Euler(0,0,90));

 

Errata type: Code | Page number: 91

The variable "jumpSpeed" should not have "private" in front of it. The variable is public.

 

Errata type: Technical | Page number: 11 | Errata date: 13 August 11

"The locations at which these VERTICES meet are known as points or vertices". should be "The locations at which these EDGES meet are known as points or vertices."

 

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Unity Game Development Essentials +    Oracle Weblogic Server 11gR1 PS2: Administration Essentials =
50% Off
the second eBook
Price for both: £27.35

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • An understanding of the Unity 3D Engine and game development
  • Build a 3D island and set of mini-games for your players
  • Incorporate terrains and externally produced 3D models to get your game environment up and running
  • Build your own first person player character
  • Combine scripting and animation to transform your static objects into dynamic interactive game elements
  • Add realism to your games by using particle systems
  • Create a professional, easy-to-navigate menu and link the menu scene with levels of your game
  • Add sound, lighting effects, realistic shadows, and other dynamic effects to your game environment
  • Creating stunning user interfaces with textures and scripting

In Detail

Game engines are central to the video games we know and love. From the artwork to the mathematics that underpin the frames onscreen, the engine calls the shots. Aside from offering one of the leading 3D game engines, Unity also provides a superlative development tool – a tool that can produce professional standard games for Mac, PC, and the Unity Web Player.

This book is a complete exercise in game development covering environments, physics, sound, particles, and much more, to get you up and working with Unity quickly.

Taking a practical approach, this book will introduce you to the concepts of developing 3D games before getting to grips with development in Unity itself. From creating 3D worlds to scripting and creating simple game elements you will learn everything you’ll need to get started with game development for the PC, Mac, and Web.

This book is designed to cover a set of easy to follow examples, which culminate in the production of a First Person 3D game, complete with an interactive island environment. By introducing common concepts of game and 3D production, you'll explore Unity to make a character interact with the game world, and build puzzles for the player to solve, in order to complete the game. At the end of the book, you will have a fully working 3D game and all the skills required to extend the game further, giving your end-user, the player, the best experience possible. Soon you will be creating your own 3D games with ease!

Get started with game development using the Unity game engine with this hands-on, easy-to-follow guide

Approach

This book follows an informal, demystifying approach to the world of game development with the Unity game engine. With no prior knowledge of game development or 3D required, you will learn from scratch, taking each concept at a time working up to a full 3D mini-game. You'll learn scripting with JavaScript and master the Unity development environment with easy to follow stepwise tasks.
The printed version of the book is in black and white, but a full color version of the images is available for download here. The eBook version, available from Packt, is in full color.

Who this book is for

If you’re a designer or animator who wishes to take their first steps into game development, or if you’ve simply spent many hours sitting in front of video games, with ideas bubbling away in the back of your mind, Unity and this book should be your starting point. No prior knowledge of game production is required, inviting you to simply bring with you a passion for making great games.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software