Make Mobile VR Games in Unity with C# for Google Cardboard
4.5 (1,788 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
14,559 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Make Mobile VR Games in Unity with C# for Google Cardboard to your Wishlist.

Add to Wishlist

Make Mobile VR Games in Unity with C# for Google Cardboard

Learn to code in .NET's C# from scratch. Make virtual reality games in Unity. Google Daydream for Cardboard.
4.5 (1,788 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
14,559 students enrolled
Last updated 8/2017
English [Auto-generated]
Current price: $10 Original price: $95 Discount: 89% off
5 hours left at this price!
30-Day Money-Back Guarantee
  • 14.5 hours on-demand video
  • 1 Article
  • 6 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Choose between the current major VR systems.
  • Write basic C# code, even with no prior experience.
  • Create a simple 3D game in Unity.
  • Design games for Virtual Reality.
  • Create a Google Cardboard VR game from scratch.
View Curriculum
  • Google Cardboard Viewer + 6" or smaller Android or iOS device
  • Android 4.1 / iOS 8 or heigher
  • A phone compatible with your Cardboard viewer (gyroscope commonly required)
  • Access to a Mac (and XCode if building to iOS devices).
  • A Mac or PC capable of running Unity.
  • OPTIONAL: Oculus Rift DK2 or CV1.

After a false-start in the 1980s, it's finally time for VR to shine. Facebook famously bought Oculus for $2bn in 2014, and now several major headsets are on the market (Oculus Rift, Sony's PlayStation VR, HTC Vive and more). This course is focused on mobile VR, which has a huge uptake via Google Cardboard and Gear VR.

Major game engines such as Unity and Unreal are now supporting VR, and the computer power required to drive VR is finally affordable. Today we have some great platforms to work with including Oculus Rift, Google Project Cardboard, and Samsung Gear VR.

Access to this course comes with an optional, free community site where you can share games and 3D models, as well as connect with 1000s of other friendly students.

What Will I Learn?

You will learn about the current VR offerings, explore their fundamental capabilities and requirements. You'll then learn basic coding in C#, and brush-up your vector maths. From there we'll build Shoot Hoop, which as a bonus is Oculus Rift compatible. Finally we'll make a fun game for Google Project Cardboard  - all using the free game development software Unity.

This course is for beginner to intermediate students of Unity and C#. No prior programming or Unity knowledge is required, and any experience you have will only help.

The free game engine Unity has the largest market share in indie games for a reason, it's modern and easy to use

Why Learn This Now?

All these new devices will need apps, and there's only one chance to be first in a particular space. Furthermore there are already millions (yes millions) of existing owners of Cardboard devices, and early Oculus Rift orders are very strong.

Please note that to build to iOS devices for Google Cardboard you will need access to a Mac running a recent version of XCode. We're are focused on mobile VR for iOS and android. An Oculus Rift is optional, but not required for the course. Hand controllers are not currently covered in the course.

In addition you can re-apply your knowledge to create apps for both the iOS and Android app store, which already have hundreds of VR apps. Now is just the right time to join them.

Who Are You To Teach Us?

Ben has already co-created the most popular game development courses on Udemy. Sam is a highly qualified computer scientist from Cambridge University. We're confident that we can help you build the skills in VR you need to get started.

The VR wave is about to come in, and I'd love you to be on it with us.

Samuel Pattuzzi & Ben Tristem

Who is the target audience?
  • Complete beginners to programming.
  • Students with no prior Unity knowledge.
  • C# programmers transferring to VR.
  • Unity Developers wanting to get ahead of the game.
  • This course is NOT yet ideal for advanced developers looking to deploy to PlayStation VR, or HTC Vive.
Compare to Other Unity Courses
Curriculum For This Course
94 Lectures
Introducing VR & Comparing Devices
7 Lectures 27:22

How to Share in the Discussions

  • Get hold of a Google Cardboard
  • Start installing or upgrading to Unity 5.2
  • Say “hi” in the discussions

Please view and comment on live section notes using the attached link. You can download the latest version as a PDF from Google Slides if you wish.

Preview 01:23

  • The top 5 VR platforms
  • Compare strength and weaknesses
  • Understand basic VR terms
The Top 5 VR Platforms Compared

  • We have many different skill levels.
  • You don’t have to start at the beginning.
  • How to find where to start.

(Unique Video Reference: 2b_IS_UVR)

Where to Dive in

  • Installing Unity 5.3.
  • Opening the Editor for the first time.
  • Installing Visual Studio.
Installing Unity

Section End QUIZ
4 questions

  • Congratulations, the hard work’s done.
  • We overviewed the VR landscape.
  • Apple now have a free developer account tier.
  • We get into actual development next!
  • Share in discussions iOS OR Android?
Section 1 Wrap-Up
Go Home - Programming in C#
18 Lectures 02:37:48
  • You'll be learning basic C# in this section
  • We'll be focusing on vector manipulation
  • Vectors are used a lot in VR development
  • You'll have a fun little game at the end.
    Please view and comment on live section notes using the attached link. You can download the latest version as a PDF from Google Slides if you wish.
"Go Home" Game Introduction

  • Create a rough plan.
  • Define the user’s “problem”.
  • Brainstorm concept, rules & requirements.
  • Document possible future ideas.
Game Design Document

  • Introduction to the Unity Editor.
  • Where to find the Console.
  • Editing scenes in Unity.
  • What is a C# script.
  • Creating C# scripts in Unity.
Scripts in Unity

  • Attaching scripts to GameObjects.
  • Anatomy of program lines.
  • How to write print statements.
  • Renaming scripts
Preview 11:28

  • Planning software with pseudo code.
  • Defining and assigning variables.
  • Printing variables with text.
  • Introduction to types.
Declaring and Assigning Variables

  • Adding and subtracting variables.
  • Using +, -, / and * operators on variables.
  • Mixing types in operations.
  • Printing text inline with numbers.
Math Operations on Variables

  • Reviewing the types of variables.
  • How to use booleans and their operators.
  • Conditional execution with if statements.
  • Reacting to different conditions.
Booleans and if statements

Mid-section Quiz
10 questions

  • Congratulations on the first quiz!
  • Reviewing what’s gone so far.
  • How to revise and consolidate.
  • Checking your code against GitHub.
Recapping the Basics

  • What is a method or function.
  • Getting input from the keyboard.
  • Using the Update() method.
  • Learning to search the Unity documentation.
Methods and User Input

  • Understand what a vector is.
  • Adding/subtracting vectors.
  • Using vectors to calculate a path home.
Vectors for Position and Movement

  • Understand Classes versus Objects.
  • Learn how to use the Vector2 type.
  • Finding the magnitude of a vector.
Preview 11:23

  • How to declare variables in a class.
  • How method declarations look.
  • Sharing variables between methods.
  • Editing variables in the inspector.
Declaring Your Own Classes

  • How variables can be overwritten.
  • Updating our vector position.
  • Recalculating our distance from home.
Updating Shared Variables

Mid-section Quiz
9 questions

  • Yet another quiz down.
  • Reviewing objects, classes and methods.
  • How to revise and consolidate.
  • Ask questions in the Q&A and forums.
Recapping Objects, Classes and Methods

  • Understand the DRY principle.
  • How to write our own methods/functions.
  • Calling methods.
  • Introduction to refactoring.
Don’t Repeat Yourself with Functions

  • Understanding the structure of programs.
  • Learning the programming jargon.
  • Statements vs Expressions.
  • Functions and execution flow.
  • The components of a class.
How to Speak Like a Programmer

  • Rubber Duck Debugging.
  • Fix our first bug.
  • Introduce play testing.
Debugging Small Programs

End of section Quiz
8 questions

  • Congratulations on finishing your 1st section
  • You've build a foundation of coding skills
  • Please try varying a the game a little
  • Why not start the next section right-away?
Section 2 Wrap-Up
Shoot the Hoop - 3D Game
29 Lectures 03:55:51
  • Your first 3D game
  • No VR device is required
  • Cardboard and Rift are optional

Please view and comment on live section notes using the attached link. You can download the latest version as a PDF from Google Slides if you wish.

Preview 01:12

  • We review the GDD format.
  • Brainstorm Concepts, Rules and Requirements.
  • Outline the scope for the section.
Game Design Document Recap

  • Introduction to the Unity Editor.
  • Adding 3D objects to a scene.
  • Moving, Scaling and Rotating.
  • Previewing our work.
Creating a 3D Scene

  • Introduction to Components.
  • Using the inspector.
  • Adding Rigidbody physics.
  • Making objects collide.
  • Playing with physics.
Rigidbody Physics

  • Brief introduction to materials.
  • Prefabs as linked copies.
  • Overriding prefab values.
  • Reverting prefab values.
Smart Copies with Prefabs

  • Creating instances programmatically.
  • The Instantiate() function.
  • Recap of if statements and GetKeyDown().
Instantiating Prefabs in Code

  • Accessing components in code.
  • Return values of functions.
  • GetComponent<>() function.
  • Adding velocity to a Rigidbody.
Adding Velocity to the Ball

  • Rotating the camera.
  • Updating transform.rotation.
  • The Quaternion type.
  • Quaternion multiplication and rotation.
Rotating the Camera in Code

  • The Unity InputManager settings.
  • Using Input.GetAxis().
  • Updating our rotation based on mouse input.
Taking Mouse Input

  • Understanding rotation behaviour.
  • Parenting game objects.
  • Avoiding camera tilt in mouse look.
  • Creating a camera gimbal.
Creating a Camera Gimbal

  • Accessing components of child objects.
  • Correct script placement in a hierarchy.
  • Global rotation vs localRotation.
Controlling the Camera Gimbal

  • Refactoring the BallSpawner script.
  • Setting the spawn position for prefabs.
  • Exposing fields to the designer.
Setting the Ball Spawn Location

Mid-section Quiz
10 questions

  • Recapping rotations.
  • Rotations and vectors.
  • Calculating the “look direction”.
Getting the Look Direction

  • Collision components.
  • Introducing OnCollisionEnter().
  • Starting to keep score
Collisions in Code

  • Creating a central score keeper.
  • Finding components globally.
  • Introduction to public methods.
  • Getting objects with FindObjectOfType<>().
Keeping Score Globally

  • Organising multiple scenes.
  • Understanding scene buildIndex.
  • Loading levels in code.
Using Multiple Scenes

  • Introducing the UI canvas.
  • Adding background images.
  • Finding uncopyrighted images.
  • Dealing with multiple screen sizes.
Creating Menu Screen UI

  • How to find suitable fonts.
  • Adding text to UI canvas.
  • Importing fonts into Unity.
UI Text and Fonts

  • Adding and styling UI buttons.
  • Connecting UI buttons to objects.
  • Calling code OnClick.
  • Writing LoadPreviousScene().
UI Buttons and Code

  • Introducing Time.deltaTime.
  • How to implement a timer.
  • Creating a default of no progression.
Timing and Triggering Events

  • Separation of presentation and data.
  • Updating UI text in code.
  • Creating a HUD.
  • Testing multiple screen resolutions.

Updating UI Text to Show Score

  • GameObject lifetime in scenes.
  • Introduction to DontDestroyOnLoad().
  • Ending the lifetime manually.
  • Displaying the score on game over.
Persisting Data Between Scenes

Mid-section Quiz
10 questions

  • Installing the Oculus SDK.
  • Enabling VR support in Unity.
  • Converting an existing project to VR.
Converting to Oculus Rift

  • Putting UI in World Space.
  • Scaling and positioning UI canvases.
  • Creating prefabs to avoid duplication.
UI for the Oculus Rift

  • Importing Unity asset packages.
  • Making our scene look beautiful.
  • Playtesting the game for difficulty.
Importing Assets to Build Levels

  • Triggers and OnTriggerEnter().
  • Writing a script from scratch.
  • Revising script communication.
  • Detecting baskets properly.
Preview 13:32

  • Adding Audio Sources in Unity.
  • Properties of Audio Sources.
  • Autoplaying and looping music.
Audio and Music

  • Audio Source components.
  • Triggering SFX in code.
  • The AudioSource.Play() method.
Triggering Sounds in Code

End of section Quiz
6 questions

  • Congratulations
  • What you learnt in this section
  • Share your creation with other students
Section 3 Wrap-Up
Squashy Toad - Google Cardboard
38 Lectures 07:23:20
  • Setup Android Studios.
  • Locating the SDK and JDK.
  • Installing the Android SDK.
  • Enabling your phones developer mode.
Becoming an Android Developer

  • Connecting the SDK to Unity.
  • Installing Unity modules individually.
  • Build the Google Cardboard Demo.
  • Deploy to your Android phone.
Building an Unity Android Project

Android Quiz
3 questions

  • Setup XCode.
  • Configuring an iOS app to deploy.
  • Signing Identities and Provisioning Profiles
  • Deploying your first app.
Becoming an iOS Developer

  • Setup your environment.
  • Build an empty project.
  • Setting your bundle identifier in Unity.
  • Deploy to your iOS phone.
Building an Unity iOS Project

iOS Quiz
3 questions

  • How to upgrade you GVR plugin.
  • Enabling built in Google VR in Unity 5.6.
  • Changes to the event system.
  • How to detect trigger down.
  • Issues with sound scaling.

(Unique Video Reference: 5b_ST_UVR)

How to Use GVR 1.70 + Unity 5.6

  • Create a virtual environment.
  • Overview of the Google VR stack.
  • Add stereoscopic cameras to games.
  • Push to your device.
Setup a VR Camera

  • Setting font size and DPI.
  • Where to scale a Rect Transform.
  • Create UI in VR environments.
  • Position and scale for comfort.
UI in VR Environments

  • Activating UI with Gaze.
  • Revising event based UI.
  • Revising the scene management.
Preview 11:02

  • What is spatial audio?
  • How can we use it in a menu scene.
  • The GVR audio listener and source.
  • Enabling the spatializer plugin.
Google VR Spatial Audio Sources

  • Use physics simulation to hop.
  • Editing terrain in the Unity Editor.
  • Adjust rigidbody mechanics for sickness.
  • Tweak materials for frog behaviour.
  • Introducing physics materials.
Avoiding Motion Sickness

  • Projecting vectors onto planes.
  • Rotating and normalizing vectors.
  • Drawing debug lines in Unity.
Debugging Vectors in Unity

  • Getting the look vector of the camera.
  • Sequencing vector operations.
  • Presenting an easy interface to the designer.
Advanced Vector Manipulation

  • Getting trigger input from GVR.
  • Using Physics.Raycast().
  • Preventing jumping unless grounded.
Jumping Only When Grounded

  • Creating a tile-based level.
  • Importing our assets.
  • Adding materials and textures.
Tile-based Terrain

Mid-section Quiz
10 questions

  • Creating lanes of traffic.
  • Generating random numbers.
  • Randomly selecting terrain.
  • Exposing terrain to the designer.
Procedurally Generated Terrain

  • Spawning a random number of trees.
  • Removing code repetition.
  • for and while loops.
Generating Infinite Terrain

  • How to scale Unity units.
  • Altering gravity acceleration.
  • Copying component values.
Scaling Down or Up

  • The problem with nested prefabs.
  • How to work around the problem.
  • Adding a collider to our tree.
Creating Nested Prefabs

  • Adding car prefabs to the road.
  • Giving them non-physical velocity.
  • Ensuring they can impact the toad.
  • Understanding Kinematic Colliders.
  • Creating a log prefab.
Moving Cars with Kinematic Colliders

  • Spawning cars with a time interval.
  • Spawning at a given location.
  • Randomizing the time interval.
Spawning Cars Randomly

  • Probability Density Functions 
  • Cumulative Distributions Functions
  • How to make any distribution in Unity
Understanding Bell Curves

  • What is a Poisson process.
  • Looking at the Exponential distribution.
  • Implementing the Exponential in Unity.
Simulating Random Traffic

  • Overview of FixedUpdate().
  • Understanding the physics engine cycle.
  • Making the logs carry the frog.
Moving Rigidbodies Smoothly

  • The issue with trigger-based grounding.
  • Why boolean grounding won’t work.
  • An explanation of count-based grounding.
  • Using this to fix jumping on moving platforms.
Count-based Grounding Checks

  • Recap for using arrays.
  • Array constant syntax.
  • Understanding array indexing and length.
  • Implementing multi-hop jumping.
Double and Triple Hop Jumping

Mid-section Quiz
10 questions

  • Rotations in Unity.
  • Euler angle definition of rotation.
  • Angle axis rotations.
  • The importance of rotation order.
Understanding 3D Rotation

  • An overview of the Quaternion class.
  • Creating rotations between 2 vectors.
  • Keeping the horizon level with LookRotation.
  • Rotating a cube to hover in-front of us.
Creating Rotations from Vectors

  • How to reload the current level.
  • Setting up the HUD UI.
  • Revising UI button binding.
HUD UI and Level Reload

  • Finding objects from anywhere in the scene.
  • How to notify death.
  • Fixing out multi-hop bug.
Lethal Objects and Death Notification

  • Disabling movement on death.
  • Adding a safe starting point.
  • Enabling/disabling the reticule.
Pausing Game Mechanics

  • Debugging performance slow downs.
  • Destroying old vehicles.
  • Triggers vs Colliders.
Garbage Collecting GameObjects

  • How to label “magic” numbers.
  • Preventing runs of dangerous lanes.
  • Enum types and when to use them.
Enums for Labeled Numbers

  • Using our Enum knowledge.
  • The Cursor API in Unity.
  • Locking the cursor to the screen.
Locking the Cursor

  • Introduction to the performance cycle.
  • How to display FPS in our game.
  • Getting a benchmark for performance.
  • Cutting down our game.
  • Disabling VSync.
Basic Performance Benchmarking

  • Common optimisations to try.
  • Using the iterative process.
  • Unity quality settings.
Performance Optimization Loop

Mid-section Quiz
10 questions

  • Using the Unity Profiler.
  • Profiler hierarchies.
  • Profiler timeline.
  • Diagnosing script issues.
Unity Profiler on Mobile

  • Revising spatial audio.
  • Creating immersive sound.
  • Adding audio to our level.
Challenge - Add Level Audio

  • Using a foreach loop.
  • How to get child transforms.
  • Spawning new lanes with a buffer.
  • Destroying lanes with a buffer.
  • Ideas for continuing the game.
Spawning and Destroying Lanes

End of section Quiz
3 questions
Continuing Your GameDev Journey
2 Lectures 05:09
  • What you’ve learnt so far…
  • You have got started with the Cardboard SDK.
  • Understood camera and gaze.
  • Started with UI in VR.
  • Made basic movement.
  • More content coming.
Course Wrap-up

In this video we introduce our other courses.

BONUS LECTURE - Our Other Courses
About the Instructor
Ben Tristem
4.6 Average rating
60,592 Reviews
285,760 Students
10 Courses
Best-selling Instructor, Game Developer, Online Entrepreneur

Hi, I'm Ben. I have a degree in computing from Imperial College London, and a physics diploma from the Open University.

I started working for myself at the age of 15, and never looked back. I explored careers as varied as being a commercial pilot, stunt-man, rock climbing instructor, and more. None of these provided a continued challenge, and stable income in the same way technology does.

After building and selling a home computer support business, I became an angel investor and business mentor here in Cambridge UK. I fell in love with teaching game development through one of my investments, and I now spend all of my time sharing my passion with people like you.

I can't wait to help you experience the fulfilment, and financial freedom, that having a deep understanding of technology brings.

So why not start learning to make games with me and my team now?

See you soon!


Sam Pattuzzi
4.6 Average rating
17,637 Reviews
106,223 Students
3 Courses
Software Engineer, University of Cambridge

I wrote my first game when I was 14 and ever since, programming has been a key part of both work and play in my life. I studied Computer Science at the University of Cambridge where I still teach undergraduates. When I'm not teaching, I'm a freelance software engineer and enjoy my work with tech start-ups and social businesses.

For me, Udemy is the opportunity to combine my passions for teaching and programming.