Easy Unity VR Tutorial For Beginners - Step by Step Guide
Easy Unity VR Tutorial For Beginners - Step by Step Guide
com/unity-vr-tutorial-for-beginners/
XR Tutorials
Installing Unity
XR Settings con�guration
1 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
Scene con�guration
Unity VR Tutorial
Are you new to VR ? Are you wondering how to create a VR App? How to create a VR
Game? Welcome to this Unity VR Development Tutorial (Oculus Quest 2 Tutorial -
Oculus Quest Tutorial).
After reading this guideline, you can create your �rst VR scene in Unity!
In this blog we will create a VR demo scene in which the player will be able to move
(teleport) and interact with game objects in a VR environment.
If you already have Unity installed and know how to create a new 3D project, you can
jump to add modules or XR settings
Unity VR Tutorial. Unity Hub is an application used for handling different Unity editor
settings, such as editor version, creating a new project or opening an existing one, etc.
For installing Unity Hub click on the Download Unity Hub button here: Download - Unity
(unity3d.com) (see image below).
The page also displays the computer requirements. A PC or laptop with Windows OS is
the recommended option.
2 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
Unity Hub is a standalone application that streamlines the way you �nd, download, and
manage your Unity Projects and installations. More info here
After the �le has been downloaded, double click on it to install. A new window will
appear.
3 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
4 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
Installing Unity
Unity VR Tutorial: In Unity Hub, click on Installs (left) and later on Install editor (blue
button, right)
For this tutorial we’ll use the 2021.2.8f1 version, so we’ll need to click on the Archive
tab and click on download archive link (blue text, see image below). It will redirect you
to the Unity archive webpage, in which you will �nd the editor versions that can be
installed.
5 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
An Oculus app is created (built) with Android OS, so we will need to install some
additional modules in Unity.
After clicking on the button described above, a new window should appear (see image
below). Select the following options:
6 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
Studio.
Visual Studio is a C# editor, the script programming environment used in Unity. The
Community version is free. More info here
7 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
This is used for several purposes. One of them is creating new projects.
• To create a new project, click on the blue button at the top right
Why not the VR template? because it doesn’t include the XR Interaction Toolkit (this is a
Unity software package) that will be used in this tutorial.
8 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
After some time, the Unity editor will be loaded, and a new window will appear for you
to give it a try clicking on the different options available to familiarize with the editor.
XR Settings con�guration
What is XR?
To con�gure our Unity project for XR, we will need to use a software package called XR
Plugin Management. It manages and helps the user with loading, initialization, settings,
and build support for XR.
XR Plugin Management
• Go to Edit/Project Settings
9 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
10 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
• In the Unity manual, the description of this package is: “provides simple
management of XR plug-ins. Manages and offers help with loading, initialization,
settings, and build support for XR plug-ins.”
11 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
What is OpenXR?
• It’s a standardized interface that allows you to con�gure several XR inputs (i.e.
Oculus Quest 2, for the Oculus Quest 2 Tutorial) in a single project and translate
them into multiple headsets and platforms. More info here
A new window may appear asking you to enable Unity's Input System.
• If you’re working on a new fresh project, Click on Yes. Otherwise, if you are using
the old Input Manager, you should consider both options
12 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
• Click on Edit
• Select the Oculus touch controller pro�le as shown below from the new window
In the same window, be sure that Render Mode is set to Multi pass
• Multi-Pass renders the Scene into two images shown separately for each eye, and
is the recommended option.
Single-Pass combines both images into a single double-width Texture, where only
the relevant half is displayed to each eye.
13 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
• Select Oculus option below XR Plugin Management. It should look like this:
• Inputs are actions taken from the Player through a device (for example mobile, PC
or VR headset like the Oculus Quest or Meta Quest for the Oculus Quest 2
Tutorial, Meta Quest Tutorial) that will be identi�ed by the game engine editor
(Unity) and will “trigger” or execute some other actions in the program,
application or game.
One example is �ring. When the player presses (input action) the “Fire” button on
a mobile game, it starts to spawn bullets (action triggered in the game) in a
certain direction.
Now we will con�gure the XR Interaction toolkit, a framework that works pretty
well with OpenXR.
14 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
• Go to Window/Package Manager
• Click on the + button
• Select “Add package from git URL”
• It will show a warning window informing you that if you have an older XR
Interaction Toolkit version you should make a backup before updating to this
newer one.
• Click on “I Made a Backup” if you have a new fresh project or, well, if you made a
backup
• After installed, select the package and import the Default Input Actions
15 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
These Default Input Actions are pre-con�gured actions that are already set up and
ready to go.
The XR Interaction Toolkit will identify the inputs in the Unity’s VR project and will use
OpenXR that will be in charge of translating them into the desired VR platform (in this
case, Oculus)
Your assets folder in the project tab should look similar to this:
If you go into the XR Interaction Toolkit folder, you should have these sample XR
interaction �les (except by the �le with the blue ray):
Select each �le and Add it to the project by clicking on “Add to …” in the inspector tab
16 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
Go to Edit/Project Settings/Preset Manager and write “Right” and “Left” for the
corresponding Action Controllers (see image below, bottom middle)
17 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
Scene con�guration
XR Origin
Normally, when you play a game, all the interactions (including camera movement)
happen inside the device (for example mobile, PC or VR headset like the Oculus Quest
or Meta Quest for the Oculus Quest 2 Tutorial, Meta Quest Tutorial), and can be
watched by the player from outside through the device’s display.
VR apps usually are called VR experiences, because they generate, well, an immersive
experience.
Immersive experience means that the player feels like “being part” of the game, and in
this case, also the scene.
In Unity, the camera and sound are “attached” to a gameobject called XR Origin.
18 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
19 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
The difference between XR Origin and XR Origin (action-based) is that the �rst one has
just the head camera and the second one also has the controllers.
The XR Interaction Manager game object that contains the script with the same name
is automatically imported
20 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
Now it’s time to add a component to the XR Interaction Manager in order to con�gure
input actions in our VR scene:
21 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
In a VR device (for example mobile, PC or VR headset like the Oculus Quest or Meta
Quest for the Oculus Quest 2 Tutorial, Meta Quest Tutorial), usually the player will have
a headset and 2 hand controllers.
Both Left and Right Hand Controllers must have the following actions con�gured in the
inspector
22 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
23 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
24 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
After following the steps above, the Unity editor is ready for checking if our headset and
hand controllers are identi�ed by the Unity editor.
At the top middle in the Unity editor, you’ll �nd a button with a play icon
Play mode is used for testing a project quickly in Unity, and this is how we will check if
our VR app demo is working �ne on the VR headset (for example mobile, PC or VR
headset like the Oculus Quest or Meta Quest for the Oculus Quest 2 Tutorial, Meta
Quest Tutorial).
If you are using Mac or Linux, you will need to compile the apk and run it on the
headset. To do this, you’ll need to follow the steps described here
25 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
If you are using Windows OS, the next step is to con�gure Oculus Link in your Oculus
device (for example mobile, PC or VR headset like the Oculus Quest or Meta Quest for
the Oculus Quest 2 Tutorial, Meta Quest Tutorial). The steps required are described in
the Oculus Link o�cial guide webpage or here
After Oculus Link is installed, we can test our progress so far entering Play mode in
Unity.
For this, you need to enable Oculus Link in your headset, go back to the Unity editor and
press the Play mode button at the middle top. Now, go back to your headset and move
your head and hands
Expected result:
Locomotion System
It’s time to move around our VR scene. Now, we will con�gure something called
“Locomotion System”
26 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
You should get in the inspector something like the image below while the Locomotion
System is selected in the inspector
27 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
This way you have added a Locomotion System into the scene. Now we need to
con�gure it.
Teleportation Area
It’s used for teleportation in the scene. For creating a Teleportation Area:
28 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
It will generate a new plane with a Teleportation Area script. This will be the area we
will be able to teleport around.
29 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
The main difference is that the Teleport Area will allow you to teleport to any point on
the plane, and Teleport Anchor is only for teleporting to a speci�c position where you
30 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
For this tutorial, we will use the previous plane game object for moving around the
scene.
31 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
Company
Legal
Home
About XR Bootcamp
Programs
Impressum
Scholarship
Privacy Policy
For Companies
Contact
For Universities
Förderung
Careers
• Enter Play mode and test it out in your VR headset
When the XR ray turns white, it means that the Teleportation Area has been hit
Continuous Move
There is another locomotion system: continuous move. To make it work in the current
plane:
32 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
• Uncheck Right Hand Move Action and Left Hand Turn Action
• Uncheck Teleportation Provider and Snap Turn Provider
If you enter Play mode, teleportation will be disabled and you can move and turn using
the Joysticks. However, this locomotion system causes something called “motion
sickness” in most people, so it’s suggested to use Continuous Move Provider just in
very speci�c cases and use teleportation instead.
VR motion sickness happens when you're moving around in a VR environment, but your
body feels like it's sitting or standing in one place.
Grabbable objects
• Create a cube
• Modify its scale to 0.3
33 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
• While the cube is select in hierarchy, add a XR Grab Interactable component in the
inspector
When adding the XR Grab Interactable component, it will automatically add a Rigidbody,
so that we can pick the cube up and interact with it in a physics-based way
34 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
If you enter play mode, you’ll be able to grab the cube when the ray is white using the
grip button
So far, you’ve created your �rst VR demo with Locomotion System and object
35 of 36 11-03-2023, 14:05
Easy Unity VR Tutorial for Beginners - Step by Step Guide https://xrbootcamp.com/unity-vr-tutorial-for-beginners/
interactions.
Awesome!
Feel free to now play around and enjoy yourself using Unity’s endless features!
I hope you enjoyed this Unity VR Tutorial (Oculus Quest 2 Tutorial, Oculus Quest Tutorial
Meta Quest Tutorial). If you're a beginner, you may also want to try the free C# Coding
Course to get started with VR Programming.
36 of 36 11-03-2023, 14:05