Create a Oculus ready VR project in Unity

Today, we are going to learn how to create a oculus ready VR project in Unity, using Oculus integration for Unity and VRTK

Hi, everyone. Today, we are going to learn how to create a oculus ready VR project in Unity, using Oculus integration for Unity and VRTK. First of all, you have to choose what version of Unity to use during project building. Our recommendation is to choose one and work with that during the project. This could be helpful if you don’t want to deal with major updates and incompatibilities. Hopefully, Unity has some versions that receive some minor updates such a stability or performance. The Long-Time Support versions, or LTS versions. You should consider one of those for your project. In our case, we chose the 2018.14 LTS version.

Oculus Unity integrations is a package that contains all frameworks of native Oculus SDK, adapted to work with Unity

Ok, we have our Unity instance downloaded and running. Let’s go to the next step, download the Oculus integration for Unity. Oculus Unity integrations is a package that contains all frameworks of native Oculus SDK, adapted to work with Unity. For example, the Platform framework for social app creations, or the Spatializer plugin to create 3D audio for VR. It also includes (and for us, is the best part) a lot of example projects using Oculus technology, this could be incredibly helpful due to lack of VR development information around the web. It’s a Unity asset so, it is super easy to install. Just go to the Asset Store and download it, this is going to be imported automatically. After that, you should see the Oculus package in your project hierarchy.

oculus in unity project

This package will give you a lot of useful tools to make your VR game, but we have more. The Virtual Reality Tool Kit, commonly know as VRTK is a set of tools that add a bunch of prefabs, scripts, etc which make the development process easy. This is a little bit more difficult to install, just follow the next steps

Go to your package folder in the project root and, in the manifest file, add the following

"scopedRegistries": [  
    {  
       "name": "npmjs",  
       "url": "https://registry.npmjs.org/",  
       "scopes": [  
          "io.extendreality"  
        ]  
    }  
],

A the end of this file, before the last bracket. This line makes Unity to download the version 1.1.3 of VRTK hosted in the registry added in the previous block.

"io.extendreality.vrtk.prefabs": "1.1.3",

What you have done is to tell the editor that download and import the VRTK tools into your project. So, be patient and wait until the import finishes. If you have done everything fine you should see the VRTK package in the Asset section in the project hierarchy view.

VRTK in unity project

The Virtual Reality Tool Kit, commonly know as VRTK is a set of tools that add a bunch of prefabs, scripts, etc which make the development process easy.

Let’s go to the final step, configure Unity for VR development. Go to player settings and, in XR settings, select Virtual Reality Supported box, then open up the Oculus section and select Shared Depth Buffer. Finally, make sure that you have Stereo Rendering Mode in Multi-Pass.

Player setting Unity

That’s all folks, this is how we create a Oculus ready VR project in Unity. If you have any question of this, feel free to ask using the contact form or social networks.