Make VR Games in Unity with C# - Cardboard, Gear VR, Oculus

Learn to code in .NET's C# from scratch. Make virtual reality games in Unity. Google Cardboard, Oculus Rift and more.
4.5 (1,036 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.
9,150 students enrolled Bestselling in Virtual Reality
$19
$95
80% off
Take This Course
  • Lectures 126
  • Length 19 hours
  • Skill Level Beginner Level
  • Languages English, captions
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

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

About This Course

Published 11/2015 English Closed captions available

Course Description

NEW: English closed captions :-)

After a false-start in the 1980s, it really is finally time for VR to shine. Facebook famously bought Oculus for $2bn in 2014, and this year will see several major headsets hit the market (Oculus Rift, Sony's PlayStation VR, HTC Vive and more).

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.

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, an Oculus Rift compatible game. 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. An Oculus Rift is optional, but not required for 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.

Note: access to this course comes with an optional, free community site where you can share games and 3D models, as well as connect with other students.

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.

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

Curriculum

Section 1: Introducing VR & Comparing Devices
Promo Video & Games List
Preview
02:29
How to Share in the Discussions
Article
01:23
  • 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.

10:18
  • The top 5 VR platforms
  • Compare strength and weaknesses
  • Understand basic VR terms
09:09
  • Installing Unity 5.3.
  • Opening the Editor for the first time.
  • Installing Visual Studio.
Section End QUIZ
4 questions
00:59
  • 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#
01:11
  • 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.
05:08
  • Create a rough plan.
  • Define the user’s “problem”.
  • Brainstorm concept, rules & requirements.
  • Document possible future ideas.
08:49
  • Introduction to the Unity Editor.
  • Where to find the Console.
  • Editing scenes in Unity.
  • What is a C# script.
  • Creating C# scripts in Unity.
11:28
  • Attaching scripts to GameObjects.
  • Anatomy of program lines.
  • How to write print statements.
  • Renaming scripts
14:10
  • Planning software with pseudo code.
  • Defining and assigning variables.
  • Printing variables with text.
  • Introduction to types.
09:00
  • Adding and subtracting variables.
  • Using +, -, / and * operators on variables.
  • Mixing types in operations.
  • Printing text inline with numbers.
13:40
  • 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
01:06
  • Congratulations on the first quiz!
  • Reviewing what’s gone so far.
  • How to revise and consolidate.
  • Checking your code against GitHub.
10:56
  • What is a method or function.
  • Getting input from the keyboard.
  • Using the Update() method.
  • Learning to search the Unity documentation.
06:52
  • Understand what a vector is.
  • Adding/subtracting vectors.
  • Using vectors to calculate a path home.
11:23
  • Understand Classes versus Objects.
  • Learn how to use the Vector2 type.
  • Finding the magnitude of a vector.
12:41
  • How to declare variables in a class.
  • How method declarations look.
  • Sharing variables between methods.
  • Editing variables in the inspector.
09:25
  • How variables can be overwritten.
  • Updating our vector position.
  • Recalculating our distance from home.
Mid-section Quiz
9 questions
00:50
  • Yet another quiz down.
  • Reviewing objects, classes and methods.
  • How to revise and consolidate.
  • Ask questions in the Q&A and forums.
16:49
  • Understand the DRY principle.
  • How to write our own methods/functions.
  • Calling methods.
  • Introduction to refactoring.
13:13
  • Understanding the structure of programs.
  • Learning the programming jargon.
  • Statements vs Expressions.
  • Functions and execution flow.
  • The components of a class.
10:23
  • Rubber Duck Debugging.
  • Fix our first bug.
  • Introduce play testing.
End of section Quiz
8 questions
00:44
  • 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
01:12
  • 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.

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

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

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


  • Adding car prefabs to the road.
  • Giving them non-physical velocity.
  • Ensuring they can impact the toad.
  • Understanding Kinematic Colliders.
  • Creating a log prefab.
11:26
  • Spawning cars with a time interval.
  • Spawning at a given location.
  • Randomizing the time interval.
12:32
  • Probability Density Functions 
  • Cumulative Distributions Functions
  • How to make any distribution in Unity
11:59
  • What is a Poisson process.
  • Looking at the Exponential distribution.
  • Implementing the Exponential in Unity.
11:14
  • Overview of FixedUpdate().
  • Understanding the physics engine cycle.
  • Making the logs carry the frog.
12:22
  • 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.
08:52
  • Recap for using arrays.
  • Array constant syntax.
  • Understanding array indexing and length.
  • Implementing multi-hop jumping.
Mid-section Quiz
10 questions
00:29
  • Let us know what you think of the beta discussions.
  • Where should the section go next?
That's all for now, folks!
Preview
Article
Section 5: Squashy Toad
03:02
  • We’ll build a Crossy Road clone.
  • We will call our clone Squashy Toad!
  • Understand a basic VR camera.
  • Simple one-button VR movement.
  • Overview the Game Design Document (GDD).
  • Download your section notes and assets.
    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.
14:28
  • Setup your environment
  • Build the Google Cardboard Demo
  • Deploy to your Android phone
18:11
  • Setup your environment
  • Build the Google Cardboard Demo
  • Deploy to your iOS phone
How to Access Source Code
Article

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!

Ben

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