Game Development Reference
In-Depth Information
When you make selections in the Scene view, Unity will first select the parent-most object; additional
clicks in the same spot will select its children.
3.
Using the left mouse button, grab the transform gizmo in the yellow square
that bridges the X and Z arrows, and drag the First Person Controller around
the scene without releasing the button.
4.
Stop Play mode.
The First Person Controller attempts to stay grounded. If you move it over a pit, it will drop until it
hits the ground again. If you move it quickly into a mountain and let go of it, it will start falling.
Move it back where it is over the terrain again, and it will once again try to position itself at the
terrain height.
Virtual Keys: The InputManager
Now is a good time for a first look at Unity's key mapping system. Key mapping allows the user
to select their favorite keys for the various input needed throughout the game. Typically, it is for
controlling a character, but it is by no means limited to that. By creating virtual keys, the scripts that
make the action happen can remain generic as far as user input goes.
The First Person Controller has several alternate keys that can be used to control it. Let's take a look
at the InputManager to see what they are.
1.
From the Edit menu, Project Settings, select Input.
2.
In the Inspector, click the Axes arrow to expand the list.
You will see 15 preset virtual keys or inputs (Figure 3-3 ).
Figure 3-3. The 15 preset inputs in the InputManager
 
Search WWH ::




Custom Search