Enabling Virtual Reality for your platform
The diorama scene we created in the previous chapter was a 3D scene using the Unity default Main Camera
. As we saw, when you pressed Play
in the Unity Editor you had the scene running in the Game
window on your 2D computer monitor. The steps for setting up your project to run in VR include:
- Set the target platform for your project builds
- Enable Virtual Reality in the XR Player Settings in Unity and set the VR SDK
- Import the device toolkit for your target device into your project (optional but recommended) and use the prescribed prefabs instead of the default
Main Camera
- Install the system tool required to build your target device
- Ensure your device's operating system is enabled for development
- Ensure your device's VR runtime is set up and running
If you are not sure, use the table to determine the target platform, virtual reality SDK, and Unity package to use for your VR device:
Device | Target Platform | VR SDK | Unity Package |
HTC VIVE | Standalone | OpenVR | SteamVR Plugin... |