O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting Started with Unity 2018 - Third Edition

Book Description

Learn how to use Unity 2018 by creating your very own 3D game while developing your essential skills

About This Book

  • Learn to create immersive 3D games and Virtual Reality experiences with Unity 2018
  • Build custom scripts to make your game characters interactive
  • Explore and implement AritificiaI Intelligence techniques to bring your game to life

Who This Book Is For

If you are an aspiring game developer interested in learning Unity 2018 and becoming familiar with its core features, then this book is for you. No prior knowledge of Unity is required.

What You Will Learn

  • Set up your Unity development environment and navigate its tools
  • Import and use custom assets and asset packages to add characters to your game
  • Build a 3D game world with a custom terrain, water, sky, mountains, and trees
  • Animate game characters, using animation controllers, and scripting
  • Apply audio and particle effects to the game
  • Create intuitive game menus and interface elements
  • Customize your game with sound effects, shadows, lighting effects, and rendering options
  • Debug code and provide smooth error handling

In Detail

The Unity game engine has revolutionized the gaming industry with its complete set of intuitive tools and rapid workflows, which can be used to create interactive 3D content. With Unity, you can scaffold your way from the basics and make make stunning interactive games.

This book will guide you through the entire process of creating a 3D game, from downloading the Unity game engine to publishing your game. It not only gives you a strong foundation, but puts you on the path to game development.

Beginning with an overview of the Unity engine and its interface, you will walk through the process of creating a game environment and learn how to use built-in assets, as well as assets created with third-party 3D modeling tools such as Blender.

Moving on, you will create custom scripts to control non-player character behaviors and gameplay. You will master exciting concepts such as Heads-Up-Displays, mini-maps, game navigation, sound effects, and lighting effects. Next, you'll learn how to create your first VR experience, right from setting up the project to image effects. You'll be familiarized with all the tools that Unity has to offer to create your own immersive VR experiences.

Each section is a stepping stone toward the completion of the final game. By the end of the book, you'll have learned advanced topics such as cross-platform considerations which enable your games to run on multiple platforms.

Style and approach

A step-by-step guide giving you the perfect start to developing 3D games with Unity 2018

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

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Getting Started with Unity 2018
      1. Third Edition
  3. Dedication
  4. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  5. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  7. Downloading and Installing Unity
    1. Game engine overview
      1. Game engines for specific game genres
        1. First-person shooters (FPS)
        2. Third-person games
        3. Other game genres
      2. Available 3D game engines
        1. CryENGINE
        2. Lumberyard
        3. Microsoft's XNA Game Studio
        4. Unreal game engine
    2. Unity – past, present, and future
      1. Version 1.0 - 2005
      2. Version 2.0 - 2007
      3. Version 3.0 - 2010
      4. Version 4.0 - 2012
      5. Version 5.0 - 2015
      6. Version 2017 - 2017
      7. Version 2018 – 2018
    3. The case for Unity
      1. Unity features
        1. Editor
        2. Graphics 
      2. Unity community
    4. System requirements
      1. Development system requirements
      2. Playback system requirements
    5. Downloading Unity 
    6. Installing Unity
    7. Summary
  8. The Unity Interface
    1. Screen real estate 
    2. Menu
      1. Unity
      2. File
      3. Edit
      4. Assets
      5. GameObject
      6. Component
      7. Window
      8. Help
    3. Scene view
    4. Game view
    5. Project window
    6. Hierarchy window
    7. Inspector window 
    8. Toolbar
      1. Transform tools
      2. Gizmo Toggles
      3. Cloud and Account Buttons
      4. Layers and Layouts
    9. Layouts
    10. Summary
  9. Designing the Game
    1. Game concept
      1. Game idea
      2. Input controls
      3. Winning and losing
    2. Game characters
      1. Cucumber Man
      2. Cucumber Beetle
    3. Gameplay
      1. Game world layout
      2. Starting condition
      3. Point system
      4. Heads-Up Display
    4. The difficulty balance
      1. Difficulty balance questions
      2. Implementation plan
    5. Project organization 
      1. Custom assets
      2. Standard assets
      3. Organization
    6. Summary
  10. Creating Our Terrain
    1. Creating the terrain
      1. Working with height maps
      2. Importing the terrain
    2. Shaping the terrain
      1. Smoothing our terrain
      2. Creating our spawn points
    3. Painting the terrain
    4. Adding water
      1. Saving your work
    5. Adding vegetation
    6. Summary
  11. Lights, Cameras, and Shadows
    1. Working with cameras
      1. Understanding camera projections
      2. Orientating your frustum
      3. Creating a Skybox 
    2. Using multiple cameras
    3. Working with lighting
      1. Directional lighting
      2. Point lighting
      3. Spot lighting
      4. Area lighting
    4. Implementing reflection probes
    5. Understanding shadows
    6. Summary
  12. Creating and Importing 3D Objects for Our Game
    1. Understanding assets and GameObjects
      1. Asset packages
      2. Understanding GameObjects
    2. Creating 3D objects in Unity
      1. Using prefabs
      2. Using additional 3D objects
    3. Using the Unity Asset Store
      1. Hands-on with the Unity Asset Store
    4. Incorporating custom assets in our game
    5. Working with imported assets
      1. Planting Cherry Trees
      2. Planting Cucumber Patches
    6. Summary
  13. Implementing Our Player Character
    1. Working with Unity's standard asset package
    2. Importing the game character
    3. Configuring a player controller
    4. Fine-tuning our character
      1. Fine-tuning the motor controls
      2. Fine-tuning scale
      3. Fine-tuning the Capsule Collider
      4. Changing and refining input controls 
    5. Animating our player character
      1. Reviewing the player controller script
      2. Reviewing the Animator component
      3. Previewing the animations
    6. Terraforming the terrain for our Cucumber Man
    7. Summary
  14. Implementing Our Non-Player Characters
    1. Understanding the non-player characters
    2. Importing the non-player characters into our game
    3. Animating our non-player characters 
    4. Incorporating the non-player characters into our game
      1. Working with the Animation Controller
    5. Terraforming the terrain for our Cucumber Beetles 
      1. Designating a sandbox area
      2. Planting additional cherry trees
      3. Creating spawning sites
    6. Adding cucumber patches to our terrain 
      1. Creating a cucumber patch area in the sandbox
      2. Planting cucumber patches
    7. Adding cucumbers to our terrain
    8. Scripting our non-player characters
      1. Getting organized
      2. Beetle patrol
      3. Beetle finds and eats cucumber
      4. Beetle attacks player on the ground
      5. Beetle stands to attack
    9. Summary
  15. Adding a Heads-Up Display
    1. Designing our Heads-Up Display
    2. Working with a canvas
      1. Adding the canvas
      2. Adding the health bar UI components
      3. Creating the Lives Remaining UI components
      4. Adding the scoring UI components
      5. Adding the cherry UI components
      6. Adding the cucumber and Cucumber Beetle UI components
    3. Creating a mini-map
    4. Scripting for dynamic content
      1. Scripting the cucumber count
      2. Scripting the beetle count
    5. Summary
  16. Scripting Our Points System
    1. Collecting cherries from trees
      1. Detecting collisions of Cucumber Man and cherry trees
      2. Simulating the collection of cherries
      3. Updating the inventory and HUD with cherry count
    2. Adding the cherry-throwing capability
      1. Creating a spot for the cherry
      2. Writing a CherryControl script
    3. Adding points based on cherry collection and combat hits
      1. Creating a points manager script
      2. Adding points for each cherry picked
      3. Adding points for hitting a beetle with a cherry
    4. Summary
  17. Scripting Victory and Defeat
    1. Designing victory and defeat conditions
    2. Updating the player's health
      1. Scripting the health bar
      2. Decrementing health
    3. Implementing victory
    4. Implementing defeat
      1. Scripting defeat based on no cucumbers remaining
      2. Scripting defeat for no lives remaining
    5. Updating the HUD with lives remaining
    6. Scripting the player character's respawning 
    7. Summary
  18. Adding Audio and Visual Effects to Our Game
    1. Discovering Unity's audio system
      1. Unity audio basics
      2. Unity's Audio Mixer
    2. Planning our game's audio
    3. Implementing our game's audio
      1. Importing audio assets
      2. Implementing the Cucumber Beetle audio
      3. Implementing the Cucumber Man audio
    4. Introduction to Unity's lights and shadows
      1. Adding light sources
        1. Directional light
        2. Point light
        3. Spot light
        4. Area light
      2. Shadows
    5. Discovering Unity's special effects
      1. Particle System
      2. Trail Renderer
    6. Adding visual effects to our game
      1. Adding a Point light to our cherry trees
      2. Add a special effect using the Particle System
    7. Summary
  19. Optimizing Our Game for Deployment
    1. Using the Profiler window
      1. Getting more out of the Profilers
    2. Optimizing scripts
      1. Optimized code example
    3. Optimizing graphics rendering
      1. Occlusion culling
      2. Lighting
      3. Mesh renderer
    4. Additional optimizations 
      1. Level of detail
      2. Static colliders
    5. Creating builds
      1. Understanding the Unity build process
      2. Build settings
        1. PC, Mac, and Linux standalone
        2. iOS
        3. tvOS
        4. Android
        5. HTML 5/WebGL
        6. Facebook
        7. Xbox One
        8. PlayStation 4 and PlayStation Vita
      3. Player Settings
    6. Summary
  20. Virtual Reality
    1. Welcome to virtual reality
      1. Development tools
        1. Oculus
        2. GearVR
        3. OpenVR
        4. PlayStation VR
    2. Enabling virtual reality in Unity
      1. Requisite SDKs
      2. Configuring your Unity project
      3. Recommendations from Unity technologies
    3. Starter content
      1. Oculus VR
        1. Oculus Sample Framework
        2. Oculus Stereo Shading Re-Projection Sample
        3. Oculus Integration
      2. Vive software
        1. Vive Stereo Rendering Toolkit
        2. Vive Input Utility
        3. Vive Media Decoder
      3. NVIDIA
        1. NVIDIA VRWorks
        2. NVIDIA VR Samples
      4. Unity Technologies
    4. Summary
  21. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think