Configuring+HTC+Vive+in+Unity

= __How to Configure your Unity Project to HTC Vive__ =

__ Download and Install SteamVR in Steam __
Before we can run Unity project in HTC Vive, we need to first setup the HTC Vive and download necessary software from Steam. This can be done by following several steps:


 * Login to your Steam account, go to **‘Library’ → ‘Tools’**. Find **SteamVR**, right click at the status and **‘Install the Game’**. See **Figure 1.**



** Figure 1: Step on how to install SteamVR into your computer **


 * Once installed, play the game and you will see a window pop out, where it detects your head mounting gear, your track pad, and your controller. See **Figure 2**.



** Figure 2: Window that shows your setup. (The status will turn green and show ‘Ready’ when the gears are properly connected.) **
 * Click the **‘SteamVR’** icon and follow the instruction on how to calibrate your HTC Vive to your available space. ([|__http://www.howtogeek.com/258356/how-to-set-up-the-htc-vive-and-start-playing-games/__] )

=**__ Setup in Unity __**=

In order to make your Unity project VR compatible with HTC Vive, there are two important components that need to be executed.


 * __** Importing SteamVR Plugin in Unity **__

Go to ** ‘Windows’ → ‘Asset Store’ **. Search **‘SteamVR Plugin’**, download and import the package into your project. See **Figure 3**.



** Figure 3: Importing SteamVR Plugin into Unity **


 * New Window will pop out after importing. It will show the recommended setting for the SteamVR Plugin. Accept the recommended setting unless you have specific requirements for your project. See Figure 4.



** Figure 4: Recommended Settings for SteamVR Plugin **


 * __** Configuring Unity to HTC Vive **__


 * Find your character and add ‘SteamVR_Camera’ script by **‘Add** Component’-- **> ‘SteamVR_Camera’**. See **Figure 5**. Note we use Unity’s default avatar from its standard asset.After adding the SteamVR_Camera script, on the inspector, click **‘Expand’** to bring up the component of the camera.



** Figure 5: Adding SteamVR_Camera to the character **
 * To add HTC VIVE’s hand controller model, create an **empty game object** inside the **FPSController(origin)** and add another script by executing **‘Add Component’ → “SteamVR_Tracked Object”**. Change the **‘Index’** in the script from **‘HMD’** to **‘None’**. See **Figure 6**. Rename the **game object** to **‘Left Controller’**. (Same for the right hand controller)



** Figure 6: Adding SteamVR_Tracked Object to the character and changing the name from empty Game Object to Left Controller. **


 * Add another **‘Game Object’** within your **‘Left Controller’** and add script that controls the controller by **‘Add Component’→ ‘SteamVR_Render Model’**. Change the **‘Shader’** to **‘Standard Shader’**.


 * In order to control the controller, in **‘FPSController (origin)’** add another script by **‘Add Component’ → ‘SteamVR_ Controller Manager’** and drag your controller to **‘Left’** and **‘Right’**. See **Figure 7**.



** Figure 7: Adding SteamVR_Controller Manager to the character **


 * To add play area into your scene, add script in the **‘Origin’** by **‘Add Component’ → ‘SteamVR_Play Area’**. A border should appear on your scene. This will configure the area that you can play with. See **Figure 8**.

** Figure 8: Adding SteamVR_Play Area into your scene **


 * **__ Building the Game __**


 * Build the game through **File → Build and Run** to enjoy your first VR game.

__**Links:**__ Home Revit to Unity