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. The final product is an immersive, interactive VR experience using the thumbsticks to move around the scene.
Export from Vectorworks
Save out a duplicate of your file since we will be making some changes. In this duplicate file, orient the entire model on the internal origin. Export as .fbx.
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 3D project.
In File>Build Settings, switch platform to Android. Texture Compression = ASTC.
In Unity, use The Asset Store (Window> Panels> Asset Store) for Oculus Integration and import via Package Manager (allow 5+ minutes). If prompted, update to the latest package & restart.
In Edit>Project Settings, install XR Plugin Management and check the box for Oculus.
In Project Settings> Player Settings> Other Settings, adjust your package name and change the minimum API level to 23. Remove the Vulkan Graphics API if using Unity 2019. Set Color Space to Linear.
Enable Developer Mode
Turn on your Quest headset and log into your Oculus app on your mobile phone. Go to Settings in the bottom right and verify connection to the VR device. Tap on the arrow button next to your device > More Settings > Developer Mode On. Restart your Quest. You only ever have to do this once.
Set up VR Camera Rig
In Assets window, navigate to Oculus> Sample Framework> Usage> Locomotion (the scene, not the folder) and double click to open.
We want to work in a copy of this so File> Save As, and enter a new scene name like “myScene”. Save it into the existing Scenes folder.
Delete the WorldGeo, TeleportPoints, CanvasWithDebug, and DestinationIndicatorSimple game objects from the scene. In Lighting Tab>Environment change the skybox image to “None”.
Finally, click into Player Controller> LocomotionController. Uncheck all the component boxes except for Locomotion Controller (Script) and Teleport Orientation Handler Thumbstick (Script).
Import your 3D Model
Drag it onto the Assets Folder in the Project window. Then drag the prefab game object into the hierarchy. Right click on it in hierarchy> Prefab> Unpack. Then, delete the CINEMA_4D_Editor game object from the hierarchy.
Position your camera by selecting and moving the PlayerController Parent Object. Just make sure to leave the Y Position at 1.
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)’,
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.
Set Up Collision
Make a new layer called CameraCollide. Assign it to the floor, decking, stairs or any other game objects you want to be able to teleport onto. Also make sure these objects have mesh collider components applied (every single child, not the parent). Check Convex & Is Trigger boxes.
Then make sure the CameraCollide Layer is declared on the PlayerController Character Camera Constraint Script. Click the check box to Enable Collision.
Build 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.
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.
Are you getting stuck anywhere? Need help? I would love to hear from you to ensure I keep this tutorial as helpful as possible.
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.