Game Development Reference
In-Depth Information
4.2 Physical Vehicles
In section 2.6, we implemented a simple car input system. In that system, we have simulated
everything manually: acceleration, braking, and steering. In this section we are going to
use physics simulator to construct a more realistic vehicle. This vehicle is going to have four
wheels with suspension springs. First step is to construct the vehicle like in Illustration 52.
Illustration 52: A simple vehicle constructed using basic shapes
Front and back axes can be made using cubes, as well as the cabin and the main body. On the
other hand, cylinders can be used to create the four wheels. After constructing the vehicle,
we have to remove all colliders from all parts, except the front and the back axes. This last
step is necessary to create a custom collision shape that helps our vehicle to behave better,
as we are going to see soon. Finally, create an empty object and add all these parts as its
children, so that it looks like Illustration 53.
Search WWH ::




Custom Search