Chapter 5

Building Player Movement Controllers

As discussed in Chapter 3, what we called a player controller is focused on movement; it is the script that determines the way that a player moves and behaves in the physics world. It is entirely focused on movement—making a ship fly, a human move along the ground, or a car to drive.

The example games call for three different vehicle types:

  1. Shoot ’em up spaceship—A spaceship that moves up, down, left, and right. Its movement need not be physics based.
  2. Humanoid character—This control script is capable of general human things, such as running forward, backward, and turning around.
  3. Wheeled vehicle—The vehicle controller utilizes Unity’s wheel colliders to work toward a more realistic physics simulation. ...

Get C# Game Programming Cookbook for Unity 3D now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.