Setting Up Your VR Project

David Brown
4 min readMay 15, 2022

--

Objective: Explain the basics on how to setup your VR project in Unity

What’s a better way to get into VR game development than with making a game? Recently I started work on a new VR project called Space Cadet VR (The game above). I would like to share the knowledge I learned on this project to help you make your first VR project.

Setting Up a Unity Project For VR

The first step you need to do is create a 3D project. Make sure you have a unity version that's at least 2020 or above.

Install XR Plugin Management

To figure your project for XR you need to download the XR plugin management. Do this by going to project settings and install the XR Plugin Management.

Enable Open XR

The next thing you need to do is check the Open XR checkbox. VR headset companies are moving towards the open XR route. This will allow you to translate one set of controls to multiple devices. So instead of downloading specific plugins for each VR headset, you can just use Open XR.

When you check the box, a message will pop up.

This pretty much means that your project wants to switch from the old to new input system. Click yes.

When it finishes you will see a yellow error icon click on it to see the issue.

The project is complaining that it has no controllers selected in the project. Since I’m using an oculus quest, I want to use the oculus touch controllers. You can add as many interaction profiles as you like.

One thing I would like to mention is the Render mode. Currently it is set to Single Pass Instanced. This means its only rendering from one eye. If you set it to multi pass it will render from both eyes which is what we want. The only downside is that it takes a bit more performance.

Download XR Interaction Toolkit

Go to your package manager and check the enable Pre-release packages. By clicking on the gear icon and then clicking on Advanced Project Settings.

Then to download it we need to add the package from a git URL. Copy and paste these words to the input field. com.unity.xr.interaction.toolkit . Now your project should be downloading the XR interaction toolkit

Now you may get a message like this. Just click the I made a backup option.

Also You need to import the starter assets in your project. It might also be called default input actions.

In your folder there should be some input action scripts. Go to all of them and click the add button.

The actual last thing we need to do is go to the preset manager in the project settings and type left and right on the designated controllers.

Then add the Input Action Manager on the XR Interaction Manager with the XRI Default Input Actions on element 0.

Now were finally done with the setup.

--

--

David Brown

I like pizza, cream soda, and making games with Unity