Preparing Unity for VR development on the Rift

We will be using the free Unity Personal License for Unity 2017.3 which, along with Unity 5.x, offers built-in support for the Rift. You are free to use any license available from the Unity site. Additionally, it is not required to have a Rift installed to build a VR application, but having the device installed on the same computer will shorten the development time greatly.

If you are just setting up your Rift computer, visit Unity's Preparing for Rift Development page for detailed instructions on preparing for Oculus development: https://developer.oculus.com/documentation/unity/latest/concepts/unity-pcprep/.

With the software installed, we can begin by creating a new Unity project. By default, Unity will store new projects in the same location as the previous project. For my work, I generally create a single directory for Unity projects and sub-directories for organization:

  1. Launch Unity 2017.3 and create a new project. I've named the project Midway and stored it with the other projects:
Figure 7.3: New project window
  1. Choose File | Build Settings... and set the platform to PC, Mac, Linux, and Standalone. You'll also need to click the Switch Platform button if you need to make a change.
  2. Choose Player Settings... from the button or the Edit | Project Settings | Player menu.
    This will display the PlayerSetting window in the Inspector.
  3. The Inspector panel will open displaying the PC, Mac, Linux, and Standalone settings. If these settings are not visible, return to the Build Settings window and confirm this choice.
  1. Turn on Virtual Reality Support under the XR Settings at the bottom of the Inspector window. For Unity 5.5 through 2017.1.2, this setting can be found in the section labeled Other Settings.
  2. Add the Oculus SDK if it is not present in the list.
  3. Close the Build Settings window.

Unity is now ready to create a VR experience. Before hitting the Play button, make sure the Oculus application is running in the background. This is the same application used to launch games and search the Oculus Store. Then run the scene by hitting the Play button. Our scene will load in the Game window and the Rift headset. But since we haven't added any GameObjects, the experience will be very boring.

Although the main camera works during this test, it will not be used during production. Instead we will use the OVRCameraRig, which comes with a host of assets, scripts, and functionalities.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.196.217