Building your First VR Experience with Unity
4.3 (358 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,561 students enrolled

Building your First VR Experience with Unity

Craft your first VR experience in Unity with a no-frills approach
4.3 (358 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,561 students enrolled
Created by Packt Publishing
Last updated 3/2018
English [Auto-generated]
Current price: $129.99 Original price: $199.99 Discount: 35% off
23 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 5 hours on-demand video
  • 4 articles
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Navigate the Unity interface
  • Script your first C# component
  • Build to VR for the first time
  • How to interact in VR
  • Lay out a simple UI for your app
Course content
Expand all 52 lectures 05:10:34
+ Getting Comfortable in Unity
11 lectures 46:19

This video gives an overview of the entire course.      

Preview 02:36
Why we are using Unity

Unity is available to install on all platforms. This video will be a quick primer on how to do so:

  • Visit the official Unity website
  • Download the installer specific to your platform
  • Run the installer to install Unity on your system 
Installing Unity

Now that we have installed Unity, let's open it up and have brief look-see. In this video, we will explore the Unity interface:

  • Explore the vast asset store available in Unity
  • Explore the different tabs in the Unity interface
  • Explore the interface and menu options and understand what they do
Opening Unity and exploring its interface

In this video, we will set up a simple scene in Unity. We'll experiment with adding different types of objects in the scene and change their axes and view the effect:

  • Learn how to add a primitive
  • Understand how to move, rotate, and scale a primitive
  • Understand the concept of the local and global space 
Setting up a basic scene

Let's now look at the Inspector Panel and look through the different components available there:

  • Learn what are components
  • Understand the need for a box collider
  • Learn what the Lighting and Materials components do 
The Inspector Panel and its components

In this video, we will see how to script a simple component in C# using Visual Studio:

  • Learn how to write a script in Visual Studio
  • Understand how to build the script so that it runs successfully and view the results in Unity 
Scripting your first C# component

In this video, we will see the importance of the Play button of Unity. When you are done adding components in the scene, you can press the Play button to see how the scene would look like in a game:

  • Understand what the Play button does
  • Learn how to add a camera to the scene
  • Understand how adding different components affects the scene 
The Play button

You can add different materials to your objects, look around the scene, adjust the cameras to modify our scene to our tastes. Let's see how:

  • Learn how to apply a different material to the object
  • Learn the different shortcut keys to move around the viewport
  • Understand how to adjust the camera to render all components 
Materials, viewport navigation, and camera adjustment

In this video, we will write a C# script that will be used to scale and rotate an object. We will also include the functionality to change the speed of scaling and rotation:

  • Create scripts to rotate and scale an object
  • Create a script to continuously change the size of the object
  • Create a script to rotate the object at different speeds 
Creating C# scripts to rotate and scale an object

In this video, we will see how to change the speed of rotation and scaling with inputs from a public function:

  • Use public variables to change the speed of rotation
  • Change the value of the public variable in-game
  • Copy a script from one object to another 
Changing the Transform values dynamically
Test Your Knowledge
3 questions
+ Building to VR for the First Time
5 lectures 20:37

In this video, we will look at all the settings that need to be done in Unity before we start the process of building to VR:

  • Learn the prerequisites in Unity before building to VR
  • Understand the naming conventions for your app 
Preview 02:27

Now that the Unity settings are done, let's do the prerequisites for viewing our experience in an Oculus Rift:

  • Go through the installation of an Oculus Rift on your PC
  • View your VR experience using an Oculus Rift  
Setting up an Oculus Rift

In this video, we will finish off the prerequisites of our other desktop VR target, HTC Vive:

  • Install Steam and SteamVR
  • Change the build settings in Unity to target the HTC Vive 
Building to HTC Vive

We'll now move on to mobile VR, specifically, the Android platform. Let's perform all the prerequisites:

  • Install the latest Android SDK
  • Prepare your VR experience for mobile 
Preparing for mobile

In this video, we will see build our VR experience to target the latest versions of Android:

  • Perform the steps to build the experience to Android
  • Change the build settings in Unity to target Google Cardboard and Google Daydream
Building to Android
Test Your Knowledge
3 questions
+ Moving in VR
18 lectures 01:28:40

Let's start by creating a simple movement script:

  • Learn how to make a character move
  • Change the speed of movement of the character
Creating a simple movement script

We have created a movement script, now let's test it:

  • Open the scene in VR
  • Test the script by changing the speed of movement 
Testing our movement script in VR

In this video, we will create some obstacles in our movement path:

  • Understand what are colliders
  • Learn the concepts of rigid bodies and implement them 
Creating obstacles

Let's now see how to use OnCollisionEnter to deal with collisions between obstacles and the player:

  • Use the OnCollisionEnter method to define what happens after a collision
  • Use a Boolean variable to stop movement of an object 
Using OnCollisionEnter

In this video, we will apply our existing scripts to new objects as we create them:

  • Apply our scripts to a newly created object and see if it works
  • Use the Debug.Log function to verify our collision detection 
Applying our scripts to a new object

In this video, we will see how to implement dynamic movement:

  • Start and stop a player based on player input
  • Write a script that implements dynamic movement
Stopping and starting based on player input

Let's add some gravity functionalities to our scene:

  • Make your player stay on the ground by setting gravity
  • Change the Angular Drag option to stop the player from toppling over
Back to gravity

We will now move on to adding some external models into our scene. These will really help to populate our scene and make it more realistic:

  • Find out the different resources where 3D models can be acquired from
  • Learn how to import 3D models from SketchUp into your scene
Importing 3D models

Now that we know how to import 3D models, let's import a 3D living room model and add it to our scene:

  • Import a 3D model of a living room and place it in our scene
  • Modify the dimensions of the objects in the living room model as per our scene requirements
Using a 3D model as an interior

Let's see how to implement moving by pointing:

  • Learn how to move in the direction your hand is pointing
  • Write a simple script that detects the controllers' direction
Writing a hand controller script

We have written our hand controller script, now is the time to test it:

  • Move through the scene in the hand controller direction
  • Make our hand set the direction of our movement
Moving using pointing

Let's now move on to the Google VR SDK. We will start by installing it:

  • Install the Google VR SDK
  • Set up a controller emulator to work through a sample scene
Installing the Google VR SDK

Google VR comes with a lot of demo objects and we can utilize them to our advantage. Let's see how:

  • Combine the objects of the Google VR test scene to our scene
  • Implement platform-specific code in the same script
Kit bashing a Google VR sample scene

Let's now test all the implement movement scripts in Daydream:

  • Build and test our scene on Daydream
  • Modify the script as needed
Testing on Daydream

Let's now test all the implement movement scripts in Cardboard:

  • Build and test our scene on Cardboard
  • Modify the script as needed
Testing on Cardboard

Let's now test all the implement movement scripts for an Oculus Rift:

  • Build and test our scene on Oculus Rift
  • Modify the script as needed
Testing on Desktop VR

Google has added a new feature for Daydream. You can now instant preview your scenes before building in a Daydream-supported mobile phone:

  • Test your scene for Daydream using the new instant preview feature
  • Understand where this feature can be used in our normal VR workflow
Daydream instant preview
Test Your Knowledge
3 questions
+ Interaction in VR
9 lectures 59:14

We have created many scripts in our scene. Let's see how we can use the Event System to trigger them:

  • Use the Playmode tint option to differentiate between the scene and play modes
  • Add the Event Trigger component in our Inspector panel 
Triggering our existing scripts using the Event System

We'll now see a different type of interaction. We will teleport to different locations by clicking on objects already present there. Let's see how we can do this:

  • Understand what are prefabs and use them for teleportation
  • Create the script that implements the teleportation function
Teleportation to fixed locations

Up until now, we were selecting objects with our gaze. Now, let's see how we can select objects using our hand controllers:

  • Transfer the selection ability to our hand controllers
  • Move around in the space by pointing and clicking at objects    
Bringing the pointer functionality to our hand

Now that we can select objects from a distance using our controller, let's see how we can select an object and move it:

  • Set up the scene to grab objects in the scene and move them
  • Modify the hand controller script to implement this functionality 
Moving objects from a distance

In this video, we will see how to script that allows us to grab objects on all platforms:

  • Create a script that grabs objects in the scene
  • Make objects fall to the ground once you let go of them
Creating a cross-platform object-grabber script

In this video, we will see how to create objects in our scene that can be grabbed:

  • Create objects for using our grab script on
  • Implement grabbing only one object at a time  
Creating grabbable objects

Let's now improve our raycasting so that we can pinpoint exactly at the object we're aiming for:

  • Create a simple script to improve our raycasting
  • Modify the raycast so as to be seen in the scene, which makes debugging easier 
Improving our raycasting

In this video, we will see how we can import the interactive functionalities that we have added to our scene to our Android build:

  • Build our interactive script to Daydream and Cardboard
  • Use the Daydream controller to recreate selecting and grabbing 
Bringing our interactive functionality to Android
Test Your Knowledge
3 questions
+ Making a Game
9 lectures 01:35:42

Let's start with creating a UI for our game:

  • Create a button and a canvas in our scene
  • Understand the optimal position to place your UI in the scene 
Setting up a UI with a button

We will now see how to create prefabs with a button:

  • Write a script that creates objects in the scene using a button in our UI
  • Set up a instantiate location for the objects
Writing a script that instantiates prefabs with a button

In this video, we will implement a score keeper for our game. Let's see how to do this:

  • Add a scoring component to the UI of our game
  • Add an element that increases by 1 based on a target being met
Keeping score

We have implement a score keeper; next, we need to figure out when the player wins or loses the game and implement it in our game:

  • Adding win/lose UI elements
  • Show the win or lose message in the scene based on the win/lose functionality
Adding win/lose UI elements

In this video, we will go through some adjustments needed before building our game for desktop VR:

  • Implement a click handler
  • Use a keyboard button to create objects in the scene 
Adjustments for desktop VR

Let's see how to add the PointerExit functionality:

  • Implement the PointerExit functionality for our buttons
  • Check and see if every functionality that we have added works or not 
Buttons and PointerExit

In this video, we will learn how create a basic level layout, create some obstacles, and add some teleport points to our game:

  • Design a level to set up the scene for our game
  • Insert obstacles into our scene to make the game difficult
  • Insert teleport points to move around in the scene
Making a game - part 1

In this video, we will make some final adjustments to adopt the game for desktop and mobile and finish building the game:

  • Make final adjustments to the game before building to mobile and desktop
  • Test the game on an HTC Vive and an Android phone 
Making a game - part 2
Test Your Knowledge
3 questions
  • System OS: Windows 7 SP1+, 8, 10; Mac OS X 10.8+
  • Visual Studio
  • Unity 5.6 (installation is covered in the course)

Building your First VR Experience with Unity aims to provide those who are new to developing virtual reality apps with an introduction to Unity, and the goal is guide the user through crafting their first VR application in a straightforward manner, which will then serve as a skeleton onto which future lessons will build expertise.

Whether a customer is looking to use virtual reality for game development, architectural walkthroughs, product showcases, or even more custom applications, this course is intended to provide a strong foundation in 3D modeling, C# coding, interaction design, SDK use, and general best practices for VR that will help make VR experiences you develop exciting and memorable (and crucially, not nauseating.) The examples will focus on using Unity3D, the premier virtual reality creation tool which accounts for over 80% of all VR content released today.

About the Author

Alex Coulombe is a VR developer and consultant based in NYC and the creative director of Agile Lens: Immersive Design, a new virtual reality company specializing in integrating immersive technology into architecture and other design disciplines. He has been utilizing VR since the Oculus DK1, where he pioneered a workflow at Fisher Dachs Associates, an architectural theater consultancy, to test theater sightlines. Since then, he's worked on a myriad of exciting projects and is a strong advocate of using VR throughout the design process and not just as a final presentation tool. Currently, he's developing new tools and experiences for Google Daydream, Oculus Rift, HTC Vive, and WebVR.

Who this course is for:
  • This course is for people who are interested in virtual reality and game development and would like to start from scratch.