VR in Unity: Pt 01- VR Dev Series 01

Objective: create a VR developing environment in Unity for Oculus Quest 2

Photo by Vinicius "amnx" Amano on Unsplash

Virtual reality is a huge trend in decades. Regardless of gaming or implement in life, VR is quite potential in many fields.

For all the VR devices, Oculus Quest 2 is the most well-known and most popular one. It has a standalone system which based on an Android core, and can be played without any cable plugged in.
I myself own a HTC Vive few years ago, which would rely on a high quality computer to run the VR games. When I noticed the Oculus Quest 2, I got attracted by its convenience.

In these series of articles, we will create and build some VR function that would runs on Oculus Quest 2, as the first step into the VR world.

Preparation

In this tutorial, we will create the project of VR in Unity, which would require some basic setting in it.

  • Unity version of 2021.1.17 or higher, with Android modular installed.
  • A Oculus Quest 2 device
  • A cable to connect PC and OQ2
  • Oculus software installed on PC

VR Project

First, let’s create a 3D project in Unity with 2021.1.17f1.

Notice that although there is a VR template, I would suggest using the basic 3D to get a fully control of our project.

With editor opened, open Edit> Project Setting> XR Plug-in Management, and select install.

Once done, there should have multiple options to select on both PC and Android tab.

For PC, I would select Open XR, which is a multiplatform developing method that would let you not only create a VR program for OQ2, but also for other compatibility devices.
When clicked Open XR, it should runs some necessary settings, and it might need to restart the editor.

After restarted, it should be finished installing the function of Open XR. Now you would notice that there is a warning sign next to it.

Click the warning sign and it should pop up a window.

Normally, you can click Fix All at the above to solve everything at one time. However, in here you should select the controller you would use to fix the problem.
Select Edit from the first warning.
And click the plus button at the column of Interaction Profiles.

Now you can add multiple controller profile to your project. In here, I would add Oculus Touch Controller Profile.

Once done, the warning sign of Open XR should be gone.
And for the Android tab, you can simply select Oculus.

Packages

Now we would need to install some packages.
Before open the Package Manager, we need to go to Project Settings> Package Manager, and click Enable Pre-release Packages.

Then select Window> Package Manager, and install these packages from Unity Registry:

  • Input System
  • OpenXR Plugin
  • XR Interaction Toolkit

With these installed, we will be ready to get our vision into VR.
Which will be in the next tutorial.

— — — —

Updated: 03/23/2022

XR Interaction Toolkit had been removed from editor version 2021.2. Here is how to add this package when you could not find it in Package Manager.

Following the guide from official website, you should add this package by its name.

Copy the name of package.
Open Package Manager and click the add button on the top left.
Select Add package by name.

Paste the name on it, and the version is optional.
Then you should be able to install the package.

--

--

--

A passionate gamer whose goal is to work in video game development.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Project Marble: Android Studio 3.3 Stable Release

My life changing journey to being AWS Certified

The History of Unix

Building and Managing Software Applications — Anywhere, Anytime

NDC Oslo 2021 — Summary

The best way to store secrets in your app is not to store secrets in your app

The Best for Budget-Friendly Managed WordPress Hosting

An Introduction to Emacs Lisp: Working with Files and Their Attributes

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
S.J. Jason Liu

S.J. Jason Liu

A passionate gamer whose goal is to work in video game development.

More from Medium

Level Design in Unity Part 1: The Floor

Making a Dash Mechanic for your game

2.5D Platformer: Creating Collectibles

Unity use right stick to aim in 2D with new input system