Categories
Tutorials Unity Vectorworks

Vectorworks to VR with Unity XR Toolkit

Ready to make your own VR experience? Unity can seem overwhelming to beginners, but it doesn’t have to be a painful experience! I’ve streamlined the most basic workflow below to help you get comfortable building VR apps with Unity using the free XR Toolkit package. The final product is an immersive, interactive VR experience with Teleportation.

This tutorial is for use with Oculus Quest 1 or 2 and touch controllers using Unity 2020.1.7f1 and the free XR Toolkit preview package. You need a USB cable to connect the Quest to your computer.


 

Export from Vectorworks

Save out a duplicate of your file since we will be making some changes. In this duplicate file, put all the design layers into 1:1 scale and orient the entire model on the internal origin. Export your design as .fbx in a few parts. The materials import easier into Unity when the .fbx file isn’t too complex or large.

There is some debate about .obj being a better option. If you choose to put in the extra work, here is the Vectorworks .obj export process.

Get Set up in Unity

Install Unity Hub if you don’t already have it. Then install the latest version of Unity 2020 with the Android module. Finally, create a new Universal Render Pipeline project.

In File>Build Settings, set Texture Compression to ASTC & switch Android platform.

In Edit>Project Settings, install XR Plugin Management 3.2.16 and check the box for Oculus. (Note at the time of writing this, version 3.2.17 was buggy.) Also in Project Settings, Player Settings> Other Settings, change the minimum API level to 23.

Finally, in Package Manager, open up Advanced Settings to enable preview packages.

Once enabled, switch the dropdown Packages selection in Package Manager to Unity Registry and scroll to the bottom to find and install XR Interaction Toolkit.

Scenic Mentor 3 Icon

Import your 3D Model

Drag it onto the Assets Folder in the Project window. Or right-click in the Assets window>Import New Asset.

Create a new scene & delete the Main Camera. Then drag your imported 3D model asset into the hierarchy. Find the CINEMA_4D_Editor game object in the hierarchy (this messes up your camera) and turn it off in the inspector. Do this by unchecking the box at the top left of the inspector window.

To apply materials, click on the 3d model object in the Assets window. In the Inspector> Materials tab, change Location to ‘Use External Materials (Legacy)’ & click Apply.

If you are finding some objects that are not rendering any texture on one or more sides, you likely have a normals issue. Check out my separate post on importing materials and fixing normals.

And here’s some video tutorials for three different import approaches:

Scenic Mentor 4 Icon

Set up VR Camera Rig

In the hierarchy, right-click and add the following XR Toolkit object to your scene:

  • Device Based > Room Scale XR Rig

Now let’s position the camera. First Click on the XR Rig parent object and manually set the position to the desired starting location in your scene.

 

Scenic Mentor 5 Icon

Set up Locomotion

In the hierarchy, right-click and add the following XR Toolkit object to your scene:

  • Device Based > Locomotion System

Click on the Locomotion System (Device-based) game object in your hierarchy. In the Snap Turn Provider component in the Inspector, add the controller that you want to enable for teleportation input. Adjust the size to 2 if you want to include both controllers.

Finally, click on the floor object of your 3D model. Using the ‘Add Component’ button in the Inspection, add the ‘Teleportation Area (Script)’ as well as a ‘Mesh Collider’.

Scenic Mentor 6 IconAdd UI Menu

In the hierarchy, right-click and add the following XR Toolkit object to your scene: ‘UI Canvas’. Then follow the steps outlined in this video:

Scenic Mentor 7 IconBuild to your Headset

Connect your Oculus Quest headset to your computer by USB. Here’s a good cable on Amazon for Quest if you don’t have one yet. Make sure you have already enabled developer mode on your headset.

In Build Settings, add the current scene into the list and select your headset in the “Run Device” dropdown. Click ‘Build & Run’. Save into the main directory (not in Assets folder). I like to put mine into a folder named Builds.

The first time you do this, your headset will prompt you to allow USB debugging. The app will automatically launch on your Quest headset. Put on your headset and start testing it out!

 

I hope this basic workflow will give you the confidence and the relevant info to start building immersive VR experiences with Unity. Subscribe to my youtube channel for more tutorials on Unity and  VR.

 

Disclosure: This post contains an Amazon affiliate link, meaning, at no additional cost to you, I will earn a commission if you click through and make a purchase.

You May Also be Interested In...