Game Development Reference
In-Depth Information
2.4 Implementing first person shooter input system
First person shooters are among the most popular 3D games. Many known titles belong to
this category, such as Call of Duty series, Doom series, and Half-Life . These games place
the camera at the position of the player face and observe the game world through his eyes.
They mainly use mouse to control the looking direction, and WSAD keys to move in the
four directions.
In this section we are going to implement this kind of input systems using what we have
learned so far. First of all we need to know how to create a player character for such kind of
games. Since the character isn't going to be visible, it is enough for us to use a cylinder with
a length of two meters, or two units in Unity editor. In fact, the default length of the cylin-
der object in Unity is 2 units, so all we have to do is to add a cylinder with the default scale.
Since the camera should be placed at the position of the player eyes, we have to add it as a
child to this cylinder. This makes the camera move and rotate with cylinder. We have also to
add a ground and maybe few objects that construct a scene in which we can navigate, as in
Illustration 21.
Search WWH ::




Custom Search