Creating the Player GameObject
The player is made up of a single GameObject. This object will contain the first-person camera, a collider, and a light source. Our GameObject will not need a light source until we address the environment in the Setting the mood section, but we can create the other components by following the steps listed here:
- Create an empty GameObject in the
Hierarchy
panel, rename itPlayer
, and move it to0
,1
,0.5
using theInspector
. This object will house the VR camera and scripts needed for player control. - Change the
Player
tag fromUntagged
toPlayer
using theInspector
panel. - With the object still selected, add a Capsule Collider by clicking the
Add Component
button in theInspector
window. Entercapsule
in the search field or select Physics from the list of categories. Next, select Capsule Collider from the list to assign it to thePlayer
GameObject.
Unity Colliders are invisible objects used to facilitate physical collisions between GameObjects. They can be exact shapes...