Creating the player avatar

Virtual reality applications provide a first-person view for the player. Because interaction is so important, Oculus also provides tools for visualizing the user's hands and the torsos of other players in multiplayer or social media titles. In these steps, we will add the OVRPlayerController prefab. This item contains a camera, tracking tools, and scripts for managing interactions:

  1. Locate the OVRPlayerController in the Project window under OVR | Prefabs. Drag this prefab into the Hierarchy window and set its position to (0, 1.8, -8).
  2. Expose the OVRPlayerController to reveal the OVRCameraRig/TrackingSpace. Drag the LocalAvatar from OvrAvatar/Content/Prefabs into TrackingSpace.
  3. Select the LocalAvatar GameObject and make sure the Start With Controller checkbox under Ovr Avatar (Script) is unchecked.
  4. Add a 3D plane to the scene. Rename the plane Ground, set its Position to (0, 0, -6) and the Scale to (2.5, 1, 2).
  5. Save the scene.
  6. Hit play.

Although our scene is still blank, we now have hands in our scene. The fingers are mapped to buttons on the Touch controllers, so touching certain buttons will make the hands point, grasp, and relax:

Figure 7.6: Game window at runtime with controller hands
..................Content has been hidden....................

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