VR Development 001
VR Software Setup
Update Unity Hub
● Why update?
To ensure compatibility and avoid discrepancies with
course instructions.
● Action:
Open Unity Hub and update it to the latest version.
Install Unity 2021.3 LTS
Step 1: Install Unity 2021.3 (LTS)
● From Unity Hub, select Unity 2021.3 LTS for installation.
● LTS = Long-Term Support: stable and supported for 2 years.
Step 2: Install Android Build Support (for Meta Quest users)
● During installation, select Android Build Support.
● Required for building .apk files for Quest.
● Skip this if you're not using a Quest.
Complete Installation
Follow Unity Hub prompts.
Wait for Unity 2021.3 LTS to download and install completely.
You’re now ready to start developing with Unity!
You should now have the recommended version of Unity installed along with
any additional required export modules.
Quest device setup
(for Quest or Quest 2)
Put your device in Developer Mode
● A Meta account is required to enable Developer Mode and access
development tools.
○ Go to: https://developers.meta.com/horizon/manage/
○ Sign in or create an account to proceed with Meta Quest development.
● Follow the instructions on Device Setup from the Meta Developer page to put
your device in Developer Mode.
○ https://developers.meta.com/horizon/documentation/native/android/mobile-device-setup/
● This will allow you to do testing and development on your device.
(Windows only) Install the Quest software and connect
your device
● From the Quest Setup page, download and install the correct application or
software for your device.
○ https://www.meta.com/gb/quest/setup/?utm_source=learn.unity.com&utm_medium=oculusredi
rect
● Within the application, follow the instructions to add your headset, either by
Link cable or by Air Link.
Meta Quest Link
VR Project Setup
Download and extract the Create with VR starter project
● Click to download the file: Create with VR Starter Project.
○ https://drive.google.com/file/d/1ocz4ZrMJQvOkufyNENtoXwLESUlXlRhV/view?usp=drive_link
Rename and relocate the project on your computer
● Locate the folder called “VR Room Project” inside the extracted folder.
● If you want, rename the project folder to “VR Room - [Your Name]”
● Move the project folder to a logical directory on your computer (e.g. a folder
called “Create with VR” on your desktop).
Add the VR Room project to the Unity Hub (1/4)
● Open the Unity Hub.
● Add your VR Room Project to the list of projects in the Unity Hub.
● If you see a warning icon next to the Editor version of your project, don’t
worry.
● This just means that the project was created with a specific version of Unity
that you don’t have on your computer. As long as you have installed a version
of Unity beginning with 2021.3, the project will run perfectly.
Add the VR Room project to the Unity Hub (2/4)
● Open the project in Unity 2021.3 LTS (Long-Term Support):
○ From the Editor Version dropdown, select a version of Unity beginning with 2021.3, then select
Open with 2021.3.X.
○ If a window pops up asking if you want to “Change Editor Version?”, select Change Version.
○ If a warning pops up that you are Opening Project in a Non-Matching Editor Installation”,
select Continue.
○ Your project should now open in Unity.
○ If there are yellow warning messages in the Console window about some of the assets, you
can ignore them or clear them.
Add the VR Room project to the Unity Hub (3/4)
● Open the project in Unity 2021.3 LTS (Long-Term Support):
○ From the Editor Version dropdown, select a version of Unity beginning with 2021.3, then select
Open with 2021.3.X.
○ If a window pops up asking if you want to “Change Editor Version?”, select Change Version.
○ If a warning pops up that you are Opening Project in a Non-Matching Editor Installation”,
select Continue.
○ Your project should now open in Unity.
Add the VR Room project to the Unity Hub (4/4)
○ Your project should now open in Unity.
○ If there are yellow warning messages in the Console window about some of the assets, you
can ignore them or clear them.
Explore the contents of the starter project and how it
differs from a typical empty project
● From the top menu, select Window > Package Manager.
● In the left panel of the Package Manager, locate the packages installed in this
project (with checkmarks next to them), including:
○ XR Plugin Management
○ XR Interaction Toolkit
○ Universal RP (Render Pipeline)
● Note: to filter and view only packages currently installed in the project, from
the top-left corner of the Package Manager window, select Packages: In
Project.
If you want to start from scratch
https://docs.unity3d.com/6000.1/Documentation/Manual/XR.html
https://learn.unity.com/tutorial/create-a-vr-starter-project-from-scratch#
Open and explore the starter scene
Rename the “Create-with-VR_Starter-Scene”
1. Rename and open the Starter Scene:
● From the Project window, open the Scenes folder.
● Rename the “Create-with-VR_Starter-Scene” as “[Your_Name] Room”.
● Double-click on your renamed scene to open it.
Rename the “Create-with-VR_Starter-Scene”
2. Explore the contents of this scene and how it differs from a typical empty
Scene:
● From the Hierarchy, select the XR Rig object and inspect the XR Origin
component.
● Select XR Rig > Camera Offset > Main Camera and inspect the Tracked Pose
Driver component.
● Select either the LeftHand Controller or RightHand Controller object and
inspect the XR Controller component.
● Select the Input Action Manager object and inspect the Input Action Manager
component.
Add a room and background
1. Add a room to the scene:
● In the Project window, expand Course Library > _Prefabs > Rooms.
● Drag one of the Room_[style] prefabs into the Hierarchy.
● From the Hierarchy, delete the Plane object.
Add a room and background
2. Add an environment outside the room’s windows:
● Open the Course Library > _Prefabs > Environments folder
● Drag one Foreground object and one Background object into the Hierarchy.
3. Adjust the sunlight in the room:
● Change the X and Y rotation of the Directional Light object to change the way
sunlight enters your room.
Run the app with the Device Simulator
You can test the scene with a Device Simulator. This simulator allows you to test the
app in-editor using the mouse and keyboard, rather than having to connect to a device
and put it on. This can be helpful for quick tests.
1. Add the Device Simulator to the scene:
● From the Project window, open Samples > XR Interaction Toolkit > [version] >
XR Device Simulator.
● Drag the XR Device Simulator Prefab into the Hierarchy.
● Click Play to test the simulator.
Run the app with the Device Simulator
2. Experiment with the keyboard and mouse controls:
● Note: To use the simulator effectively, a mouse with a clickable scroll wheel is
required.
● To control the camera: hold right-click.
● To control the left controller: hold Left Shift or toggle with T.
● To control the right controller: hold the Spacebar or toggle with Y.
● To pan around with a device: move the mouse.
● To rotate a device: hold the middle mouse button.
● To reset the position and rotation of devices: press V.
XR Rig Simulator Keyboard Shortcuts
Since there are three devices in VR, all of which can be simulated independently, the
process for using the rig simulator is:
● Step 1: Activate the device you would like to control – multiple can be selected at
once
● Step 2: Use the control(s) for that device
Use the shortcuts for Step 1 and Step 2 (A and B) below as reference.
XR Rig Simulator Keyboard Shortcuts
Run the app with the Device Simulator
3. See more controls available for the device simulator:
● From the Hierarchy, select the XR Device Simulator.
● In the XR Device Simulator component, double-click on one of the Action variables
to open the Action Editor.
● Expand the Actions to view their Bindings.
● From the left Action Maps panel, select either Main or Input Controls to view
additional action mappings.
Run the app with the Device Simulator
4. Important: disable the Device Simulator if you do not plan on using it:
● Select the Device Simulator object then disable it in the Inspector window.
● Having the device simulator active when running the project on your device will
cause problems.
Test in VR through Unity
In order to run the project on your device through Unity, you need to install the correct
plug-in for development. OpenXR is an open source API that connects Unity to
supported VR hardware devices. It is recommended that you use this plug-in, since it
allows you to deploy to multiple devices through a single, standardized API.
Test in VR through Unity
1. Install the OpenXR Plugin for desktop testing:
● From the top menu, select Edit > Project Settings, then select the XR Plug-in
Management panel from the sidebar.
● In the Windows, Mac, Linux tab, select OpenXR from the list of available Plug-in
Providers to install that plug-in.
Test in VR through Unity
2. Resolve any warnings by setting up an interaction profile.
After adding the OpenXR plugin, there may be a warning or error icon that appears next to
the plugin Name.
● If there are no warnings or errors, you can skip to step 3 below to connect your device
through the Quest Link Software.
● If there is a warning, click on the warning icon to open the OpenXR Project Validation
window, which will tell you that you need to add an interaction profile for the device
you’re using.
● Select the Edit button to open the OpenXR settings panel.
Test in VR through Unity
3. Connect your device through the Quest Link Software:
● Make sure your device is plugged into your computer using a compatible cable.
● Make sure the Quest App is running and has successfully recognized your device.
● If you have not yet downloaded the Quest App, you find it on the Link Setup page.
Test in VR through Unity
4. Test the project on your device:
● Make sure the XR Device Simulator in your scene is disabled. If it is enabled,
your head tracking will not work.
● Select Play in the Unity Editor and put on your headset.
Build and run on your device
● Since the Quest is a standalone device (meaning it does not need to be connected
to a computer), you can build an app and test it directly on the device,
disconnected from your computer.
● If you are on a Mac and cannot test your app through the Windows Quest software
as in the previous step, this will be the primary way for you to test your app on
your headset.
● In order to build your app to the Quest headset, you will need to configure plug-ins
for the Android build target.
Build and run on your device
1. Install the OpenXR for Android builds:
From the XR Plug-in Management settings, select the Android tab, then select OpenXR
from the list of available Plug-in Providers to install that plug-in.
● Note: You will only have an Android tab if you installed the Android export module.
● If you don’t see an option for OpenXR in the Android tab, first go back to the Desktop
tab and select OpenXR there, then return to the Android tab.
Build and run on your device
2. Resolve warnings by setting up an interaction profile.
● Click on the new warning or error icon that appears to open the OpenXR Project
Validation window, which will tell you again that you need to add an interaction
profile.
● Select the Edit button to open the OpenXR settings panel.
Build and run on your device
● In the Android tab, select the + button to add the appropriate profile for your device,
then enable all OpenXR Feature Groups.
Build and run on your device
● If any additional errors or warnings appear, click on the error or warning icons to
resolve them.
Build and run on your device
3. Prepare your scene for building:
● Make sure the XR Device Simulator in your scene is disabled. If it is enabled, your
head tracking will not work.
● From the top menu, click File > Build Settings.
● Click Add Open Scenes to add your scene.
4. Switch to the Android build platform:
● In the Platform section, select Android.
● Click Switch Platform, and wait for your project to switch to the Android platform.
● Note: Android will only show up as a possible build target if you successfully
installed the Android Export Module during installation of the Unity Editor.
Build and run on your device
5. Select your device as the build target:
● Make sure your VR device is turned on and plugged in.
● Next to the Run Device drop-down, click Refresh, then select your VR device.
Your device may show up as a device ID or as a device name.
● Note: If your device does not show up in the list, try putting on the device. It may
prompt you to Allow USB debugging. If it is still not showing up in the list, try
restarting your device, making sure it’s in Developer Mode, or restarting Unity.
Build and run on your device
6. Build and run your project on your device:
● Click Build and Run.
● When prompted to choose a location, create a new “Builds” folder, then Save
your project as “[YourName] - VR Room - 1.1”.
● Note: When you build your app for the first time, it may take several minutes to
compile.
Troubleshooting tips
Note: The app is automatically saved onto your device in the “Unknown Sources”
section of your App Library. You may need to follow steps to allow apps from unknown
sources in order to locate your app.
Troubleshooting tips:
● If the app runs, but it does not take up the entire field of view, it is likely a
problem with plug-ins.
● If the app runs, but the entire scene moves along with your head, it is likely
because you have the Device Simulator active or you do not have the Input
Action Manager configured properly.
ANY QUESTIONS?