Developing VR apps in Unity can be very time consuming. But it doesn't have to be that way! VR Builder is the free and open source VR Unity plug-in that allows developers to create better VR content faster in Unity.
In this tutorial you will learn to
I created this Unity project using free assets from the Unity Asset Store. I chose to use relatively simple assets as they provide a good framerate in VR and thus a better experience. Below I've listed the links to the various assets I used to build this Unity project so that you can easily recreate the same scenario:
I started by downloading VR Builder from the Unity Asset Store. Next, I installed VR Builder by following the included installation instructions.
After downloading and installing VR Builder in Unity, the Setup Wizard appears. The Setup Wizard is your best friend as it helps you easily configure your Unity scene in VR. Press Next.
In the first step, the Setup Wizard prompts you to set up a training scene. In this case, you can simply ignore this because we don't want to create a training scene in VR. Instead, we just want to make this scene VR-ready. Press Next again.
After that, you can select your VR hardware. In my case, it is Windows Mixed Reality (Windows MR). Press Next.
Finally, the Setup Wizard shows an overview of helpful resources. You can skip this for now and click Finish.
A pop-up window will appear asking you to wait until the setup is complete. Click Next and wait a few seconds for Unity to set everything up.
Then the Project Settings window appears. There you can see that Windows Mixed Reality is enabled, as I selected it earlier in the Setup Wizard. If the hardware you selected earlier was not automatically enabled, you can do it manually at this point. After you have made sure that the correct VR hardware is selected, you can close the Project Settings window again.
You can also close the VR Builder Core Package window because everything has been installed correctly.
The large pop-up window in the center of the screen is the workflow editor for the VR Builder training engine, which allows you to visually define the process of your VR app. Since the workflow editor is not important for this video (we are not creating a training scene), you can close this window.
In the Hierarchy you can see that VR Builder has added some game objects to the scene: [TRAINING_CONFIGURATION], [INTERACTION_RIG_LOADER], [TRAINEE] and [COURSE_CONTROLLER].
Since there is no training scene in this tutorial and we want to interact with everything in a sandbox, you must disable the [COURSE_CONTROLLER] in the Inspector tab to avoid its default behavior.
To teleport through the scene in VR, you need to add a component to the walkable surface. In this Unity scene, I created a plane called GroundPlane - a standard Unity plane, which is located directly under the floor of the cabin. You can easily find it in the Hierarchy. Select it.
On the Inspector tab, click Add Component, search for Teleportation Area, and select it.
Then, you need to change the layer from Standard to XR Teleport. This will make it possible to teleport through the plane.
Note that this behavior is not triggered by VR Builder, but by the Unity XR Interaction Toolkit (XRIT). But since VR Builder has already configured the rig, that's all you need to do. Too easy!
As a final step, I made the wine bottle and the two glasses on the table grabbable in virtual reality. To do this, select WineBottle in the Hierarchy.
On the Inspector tab, click Add Component, search for Grabbable Property, and select it. Grabbable Property ensures that physics and collision are added, so the object can behave realistically in virtual reality. This works in a similar way when setting up a training scene.
Finally, select both WineGlass objects and repeat the same steps.