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,198 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.
11,181 students enrolled Bestselling in Virtual Reality
Take This Course
  • Lectures 92
  • Length 14 hours
  • Skill Level Beginner Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works


Find online courses made by experts from around the world.


Take your courses with you and learn anywhere, anytime.


Learn and practice real-world skills and achieve your goals.

About This Course

Published 11/2015 English

Course Description

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

What are the requirements?

  • 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.

What am I going to get from this course?

  • 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.

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.

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.


Section 1: Introducing VR & Comparing Devices
Promo Video & Games List
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.

  • The top 5 VR platforms
  • Compare strength and weaknesses
  • Understand basic VR terms
  • Installing Unity 5.3.
  • Opening the Editor for the first time.
  • Installing Visual Studio.
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 2: Go Home - Programming in C#
  • 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.
  • Create a rough plan.
  • Define the user’s “problem”.
  • Brainstorm concept, rules & requirements.
  • Document possible future ideas.
  • Introduction to the Unity Editor.
  • Where to find the Console.
  • Editing scenes in Unity.
  • What is a C# script.
  • Creating C# scripts in Unity.
  • Attaching scripts to GameObjects.
  • Anatomy of program lines.
  • How to write print statements.
  • Renaming scripts
  • Planning software with pseudo code.
  • Defining and assigning variables.
  • Printing variables with text.
  • Introduction to types.
  • Adding and subtracting variables.
  • Using +, -, / and * operators on variables.
  • Mixing types in operations.
  • Printing text inline with numbers.
  • Reviewing the types of variables.
  • How to use booleans and their operators.
  • Conditional execution with if statements.
  • Reacting to different conditions.
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.
  • What is a method or function.
  • Getting input from the keyboard.
  • Using the Update() method.
  • Learning to search the Unity documentation.
  • Understand what a vector is.
  • Adding/subtracting vectors.
  • Using vectors to calculate a path home.
  • Understand Classes versus Objects.
  • Learn how to use the Vector2 type.
  • Finding the magnitude of a vector.
  • How to declare variables in a class.
  • How method declarations look.
  • Sharing variables between methods.
  • Editing variables in the inspector.
  • How variables can be overwritten.
  • Updating our vector position.
  • Recalculating our distance from home.
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.
  • Understand the DRY principle.
  • How to write our own methods/functions.
  • Calling methods.
  • Introduction to refactoring.
  • Understanding the structure of programs.
  • Learning the programming jargon.
  • Statements vs Expressions.
  • Functions and execution flow.
  • The components of a class.
  • Rubber Duck Debugging.
  • Fix our first bug.
  • Introduce play testing.
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 3: Shoot the Hoop - 3D Game
  • 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.

  • We review the GDD format.
  • Brainstorm Concepts, Rules and Requirements.
  • Outline the scope for the section.
  • Introduction to the Unity Editor.
  • Adding 3D objects to a scene.
  • Moving, Scaling and Rotating.
  • Previewing our work.
  • Introduction to Components.
  • Using the inspector.
  • Adding Rigidbody physics.
  • Making objects collide.
  • Playing with physics.
  • Brief introduction to materials.
  • Prefabs as linked copies.
  • Overriding prefab values.
  • Reverting prefab values.
  • Creating instances programmatically.
  • The Instantiate() function.
  • Recap of if statements and GetKeyDown().
  • Accessing components in code.
  • Return values of functions.
  • GetComponent<>() function.
  • Adding velocity to a Rigidbody.
  • Rotating the camera.
  • Updating transform.rotation.
  • The Quaternion type.
  • Quaternion multiplication and rotation.
  • The Unity InputManager settings.
  • Using Input.GetAxis().
  • Updating our rotation based on mouse input.
  • Understanding rotation behaviour.
  • Parenting game objects.
  • Avoiding camera tilt in mouse look.
  • Creating a camera gimbal.
  • Accessing components of child objects.
  • Correct script placement in a hierarchy.
  • Global rotation vs localRotation.
  • Refactoring the BallSpawner script.
  • Setting the spawn position for prefabs.
  • Exposing fields to the designer.
Mid-section Quiz
10 questions
  • Recapping rotations.
  • Rotations and vectors.
  • Calculating the “look direction”.
  • Collision components.
  • Introducing OnCollisionEnter().
  • Starting to keep score
  • Creating a central score keeper.
  • Finding components globally.
  • Introduction to public methods.
  • Getting objects with FindObjectOfType<>().
  • Organising multiple scenes.
  • Understanding scene buildIndex.
  • Loading levels in code.
  • Introducing the UI canvas.
  • Adding background images.
  • Finding uncopyrighted images.
  • Dealing with multiple screen sizes.
  • How to find suitable fonts.
  • Adding text to UI canvas.
  • Importing fonts into Unity.
  • Adding and styling UI buttons.
  • Connecting UI buttons to objects.
  • Calling code OnClick.
  • Writing LoadPreviousScene().
  • Introducing Time.deltaTime.
  • How to implement a timer.
  • Creating a default of no progression.

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

  • GameObject lifetime in scenes.
  • Introduction to DontDestroyOnLoad().
  • Ending the lifetime manually.
  • Displaying the score on game over.
Mid-section Quiz
10 questions
  • Installing the Oculus SDK.
  • Enabling VR support in Unity.
  • Converting an existing project to VR.
  • Putting UI in World Space.
  • Scaling and positioning UI canvases.
  • Creating prefabs to avoid duplication.
  • Importing Unity asset packages.
  • Making our scene look beautiful.
  • Playtesting the game for difficulty.
  • Triggers and OnTriggerEnter().
  • Writing a script from scratch.
  • Revising script communication.
  • Detecting baskets properly.
  • Adding Audio Sources in Unity.
  • Properties of Audio Sources.
  • Autoplaying and looping music.
  • Audio Source components.
  • Triggering SFX in code.
  • The AudioSource.Play() method.
End of section Quiz
6 questions
  • Congratulations
  • What you learnt in this section
  • Share your creation with other students
Section 4: NEW: Squashy Toad BETA - Google Cardboard
  • Setup Android Studios.
  • Locating the SDK and JDK.
  • Installing the Android SDK.
  • Enabling your phones developer mode.
  • Connecting the SDK to Unity.
  • Installing Unity modules individually.
  • Build the Google Cardboard Demo.
  • Deploy to your Android phone.
Android Quiz
3 questions
  • Setup XCode.
  • Configuring an iOS app to deploy.
  • Signing Identities and Provisioning Profiles
  • Deploying your first app.
  • Setup your environment.
  • Build an empty project.
  • Setting your bundle identifier in Unity.
  • Deploy to your iOS phone.
iOS Quiz
3 questions
  • Create a virtual environment.
  • Overview of the Google VR stack.
  • Add stereoscopic cameras to games.
  • Push to your device.
  • Setting font size and DPI.
  • Where to scale a Rect Transform.
  • Create UI in VR environments.
  • Position and scale for comfort.
  • Activating UI with Gaze.
  • Revising event based UI.
  • Revising the scene management.
  • What is spatial audio?
  • How can we use it in a menu scene.
  • The GVR audio listener and source.
  • Enabling the spatializer plugin.
  • Use physics simulation to hop.
  • Editing terrain in the Unity Editor.
  • Adjust rigidbody mechanics for sickness.
  • Tweak materials for frog behaviour.
  • Introducing physics materials.
  • Projecting vectors onto planes.
  • Rotating and normalizing vectors.
  • Drawing debug lines in Unity.
  • Getting the look vector of the camera.
  • Sequencing vector operations.
  • Presenting an easy interface to the designer.
  • Getting trigger input from GVR.
  • Using Physics.Raycast().
  • Preventing jumping unless grounded.
  • Creating a tile-based level.
  • Importing our assets.
  • Adding materials and textures.
Mid-section Quiz
10 questions
  • Creating lanes of traffic.
  • Generating random numbers.
  • Randomly selecting terrain.
  • Exposing terrain to the designer.
  • Spawning a random number of trees.
  • Removing code repetition.
  • for and while loops.
  • How to scale Unity units.
  • Altering gravity acceleration.
  • Copying component values.
  • The problem with nested prefabs.
  • How to work around the problem.
  • Adding a collider to our tree.

  • Adding car prefabs to the road.
  • Giving them non-physical velocity.
  • Ensuring they can impact the toad.
  • Understanding Kinematic Colliders.
  • Creating a log prefab.
  • Spawning cars with a time interval.
  • Spawning at a given location.
  • Randomizing the time interval.
  • Probability Density Functions 
  • Cumulative Distributions Functions
  • How to make any distribution in Unity
  • What is a Poisson process.
  • Looking at the Exponential distribution.
  • Implementing the Exponential in Unity.
  • Overview of FixedUpdate().
  • Understanding the physics engine cycle.
  • Making the logs carry the frog.
  • 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.
  • Recap for using arrays.
  • Array constant syntax.
  • Understanding array indexing and length.
  • Implementing multi-hop jumping.
Mid-section Quiz
10 questions
  • Rotations in Unity.
  • Euler angle definition of rotation.
  • Angle axis rotations.
  • The importance of rotation order.
  • 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.
  • How to reload the current level.
  • Setting up the HUD UI.
  • Revising UI button binding.
  • Finding objects from anywhere in the scene.
  • How to notify death.
  • Fixing out multi-hop bug.
  • Disabling movement on death.
  • Adding a safe starting point.
  • Enabling/disabling the reticule.
  • Debugging performance slow downs.
  • Destroying old vehicles.
  • Triggers vs Colliders.
  • How to label “magic” numbers.
  • Preventing runs of dangerous lanes.
  • Enum types and when to use them.
  • Using our Enum knowledge.
  • The Cursor API in Unity.
  • Locking the cursor to the screen.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Ben Tristem, 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!


Instructor Biography

Sam Pattuzzi, 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.

Ready to start learning?
Take This Course