Intro to VR: Setting up XR Origin

Virtual Reality is a technology where people can achieve certain level of immersion inside a computer generated virtual environment or 3D images using devices, such as Oculus Rift, and such. Unity game engine provides different features and API base that is compatible with such device. A developer can easily develop a virtual environment and create interaction between the environment and the devices. To start with the VR development, it is necessary to understand how we set up XR Origin (Action-Based) in Unity. 

XR Origin (Action-Based) 


STEP 1. From the Unity Package Manager, import two packages:

STEP 2. Add XR Origin (Action-Based) game object in the hierarchy. When you add XR Origin, XR Interaction Manager automatically gets added in the project. 

Setting the Tracking Origin Mode to Floor


Setting the Tracking Origin Mode to Device

STEP 3. Inside XR Origin, there are left hand and right hand controllers. XR Interaction Toolkit package provides the presets to create interaction between the VR environment and UI using their Input Events. We can easily provide these input references to the hand controllers of XR Origin. 

STEP 4. Set up VR Hands Prefab to the Controller. (Refer to this Section)

STEP 5. Set up Interaction Manager. Add Input Action Manager

Inside XR Origin, we add Input Action Manager and set a reference to XRI Default Input Actions in Action Assets.