VR Interaction Framework

Updated on

July 16, 2024

Note: The documentation for this integration used to be hosted by Bearded Ninja Games at https://wiki.beardedninjagames.com/en/Integrations/VRBuilder, but it is outdated. Ensure that the VRIF-Integration_[xxxx].unitypackage you get when downloading VRIF is the same as the one on our GitHub repo. If not, please use the one from our repository.

About VR Builder & VR Interaction Framework

The free VR Builder base product already offers a set of basic interactions, which utilize the Unity XR Interaction Toolkit. But it also offers the option to switch to more sophisticated interaction systems, such as the VR Interaction Framework (VRIF) by Bearded Ninja Games. In a joint effort, we developed an integration so that our users can directly use VR Interaction Framework's capabilities within VR Builder. As this integration is already provided within the VR Interaction Framework asset, there is no additional charge when wanting to use both products combined.

This tutorial explains how to create a project with VR Interaction Framework (VRIF) and VR Builder to get you up and running in no time!

Broadly, the process is as follows:

  1. Import VRIF
  2. Import VR Builder
  3. Disable VR Builder’s XR Interaction Component
  4. Import the VRIF Integration

The next chapters will cover these steps in detail. Finally, we will give a few pointers on how to use this integration with VR Builder.

Let’s get started!

Step 1: Importing VRIF

We need to import VRIF first as it imports a complete project. This is pretty straightforward, and you can refer to the official VRIF documentation.

Before proceeding, ensure the project compiles.

If you get an error like the one in the picture, ensure all packages in the package manager are up to date. This specific error can be fixed by either updating or removing the Oculus XR package, depending on your needs.

Step 2: Importing VR Builder

Next, let’s import VR Builder. As before, let’s select the package in the Package Manager and click Import. VR Builder will import and fetch the necessary Unity packages.

In case Unity gets stuck while importing packages, just close and restart Unity.

After the import, you will get to this dialog.

The XR Interaction Toolkit asks for this update since version 2.0. We are using a different interaction framework and not XRIT, so this choice is irrelevant. Select “No Thanks” and continue.

You will finally get to VR Builder’s setup wizard. We still have to set up the integration, so it won’t be useful for now. Close it.

Step 3: Configuring VR Builder

Since VRIF comes with its own set of interactions, we don’t need the XR Interaction Component (managing XRIT interactions) in our project.

Disable it in Project Settings > VR Builder > Settings, by ticking off the corresponding checkbox. The project will recompile and the interaction component will be disabled.

At this point, you might also want to remove the XR Interaction Toolkit package as it’s not needed by VR Builder anymore.

Step 4: Importing the VRIF Integration

The integration package can be found under Assets/BNG Framework/Integrations/VR Builder. Import the package in the project and you should be good to go!

A good way to see if everything works as intended is to open the included demo scene. You can do so from Tools > VR Builder > Demo Scenes > VRIF Integration.

This is a variant of the VRIF demo scene where a VR Builder process showcases all interactions that currently work with VR Builder. When you press Play, a voice will start giving you instructions. You know that you have set up everything correctly when this works.

Naturally, you will need to set up your VR hardware before interacting with the demo scene.

Other demo scenes and add-ons

VR Builder may show other demo scenes in its menu, like for example the Core demo scene from the base package. Usually, these scenes are built on the XR Interaction Component so they will not work on the project just set-up.

Add-ons will generally work with the VRIF integration unless they’re specifically designed for XRIT or other frameworks. Our current add-ons Animations, Track & Measure, States & Data, Randomization and Menus do not make use of XR interactions and will work without any issues. Their demo scenes, however, will not - you can try them in a separate VR Builder-only project, for example.

Getting started with the VRIF Integration

You can now start using VR Builder together with VRIF. Things work much like standard VR Builder. You can now create a new scene and process with the VR Builder Setup Wizard and you can use all interaction-related conditions like Grabbed, Touched and so on. 

A VRIF-compatible property will be added to the referenced game object when you do so. There are some minor differences in the behavior of these interactions, so we suggest checking the documentation included with the integration for more details.

One notable difference is that the VRIF integration lacks support for the restrictive environment (i.e. the ability to make objects non-interactable when the user is not supposed to interact with them).

Rigs

When you create a new VR Builder scene with VRIF, the VRIF advanced rig will be spawned in the scene by default. You can find the other VRIF rigs adapted for VR Builder in the Assets\MindPort\VR Builder\Add-ons\VRIF Interaction Component\Resources folder. 

Feel free to delete the one in the scene and drag one of the other ones as you see fit.

Switching Build Platform

Switching build platform while the VRIF Integration is in the project can result in compile errors like the following.

If this happens to you, navigate to Project Settings > Player > Script Compilation and add VR_BUILDER to the Scripting Define Symbols list, then click Apply. The project will then recompile.

Next steps

We hope this helped you getting started with VRIF without issues. Currently, VRIF is more mature and feature-rich than the XR Interaction Framework, and it offers more ready-made useful interaction that can be leveraged to bring your VR Builder app to the next level.

Please share with us your feedback and which further interactions or features would help you.

And if you make something awesome, we’d like to encourage you to share it in our Discord community!

Ready to get Started?

Download Vr Builder