Game Development Reference
In-Depth Information
The first problem is that the component functions from near the First Person Controller's bellybutton,
the location of its transform pivot point (Figure 3-7 ). The other problem is that you've lost the ability
to look up and down. If you inspect the First Person Controller's Mouse Look component, you will
see that its Axes parameter is set to use Mouse X. This time, it is referring to the mouse movement.
Traditionally (think graph paper), the X axis is on the horizontal and the Y axis is on the vertical. With
the mouse, this means X or horizontal mouse movement. In the script, it controls rotation on the First
Person Controller's Y axis, or look left/right. It turns out that the Mouse Look component does have
the option to use both axes, but other components on the First Person Controller will keep it from
tipping up or down. The bottom line here is that although you can combine specialty components,
there are often good reasons to put them on separate gameObjects.
Figure 3-7. The camera component on the First Person Controller gameObject
9.
Right-click on the First Person Controller's Camera component, and select
Remove Component (Figure 3-8 ).
 
Search WWH ::




Custom Search