Viewing in VR
Viewing in VR
There are several different ways to view a unity program through a VR HMD. Some simply allow you to look around, while others like SteamVR also provide tools for interacting with the world using controllers. This first method is a quick and easy way to be able to look around in VR, which makes it great for purely visual VR experience but does not setup any controller use.
In Unity, navigate to Edit -> Project Settings -> Player. This should pop up a settings window in the Inspector. Go to the bottom section titled XR Settings and check the "Virtual Reality Supported" box.
You can then use the "+" button in the bottom right of the Virtual Reality SDKs box to add platforms unity will try to render to. If you are trying to view with an Oculus then add "Oculus" and put it at the top of the list. If you're using a Vive, put "OpenVR" first. If you would like an onscreen simulation of what view through a HMD would look like, use "Mock HMD - Vive."
Unity will try to load in the order things are listed. For example, if you put "Oculus" first and then "Mock HMD - Vive," Unity will first look for a connected Oculus Rift to load to but if that fails it will then display the Mock HMD view.
Note again that this is primarily a method of being able to view in VR - it does not do any controller setup.