SteamVR

@Brandon

SteamVR

[@Duncan]

SteamVR Plugin is a great plugin created by Valve that makes it really easy to run a Unity program in SteamVR.  Two of our other Unity tutorials, Throw a Ball and Teleporting in VR, use SteamVR, so I'll explain the (quick!) setup process here. 

First, create a new Unity project.  SteamVR Plugin is available via the Unity Asset Store.  In the top toolbar, navigate to Window>Asset Store (or alternatively, Ctrl/Cmd + 9). In the search bar, look for "SteamVR Plugin."

Once you've found it, click import. There should be a popup asking if you want to "Import Complete Project." We are working with a fresh project so there is nothing to be overwritten.  Click import again.

A popup should appear that says "Import Unity Package" on the top, and should have a bunch of checkboxes. This is where you can choose to selectively import parts of an asset package without importing the entire thing.  When working on a specific project you can deselect parts of the package to minimize unused files, but for now we'll import them all.

We'll be using the "[CameraRig]" and "[SteamVR]" prefabs that were installed as part of the SteamVR Plugin.  From the Assets folder, you can find them in SteamVR->Prefabs.  First, in the Hierarchy window, delete the "Main Camera" object that Unity automatically creates as part of your new project.  It will be replaced by a component of "[CameraRig]".  Then drag "[CameraRig]" and "[SteamVR]" from the SteamVR Prefabs folder into your project hierarchy. 

If you click the dropdown of CameraRig you'll see three objects.  "Camera (head)" is the component that is replacing MainCamera and is what players will view the scene from.  "Controller (left)" and "Controller (right)" will be linked to the user's two controllers and we will attach colliders and scripts to these objects to allow interaction with out scene.  "[SteamVR]" helps smooth out the application at run time.  You're now all set up to use these components for our following tutorial or a project of your own design!