Game Development Reference
In-Depth Information
Illustration 53: Vehicle parts added as children to an empty game object
Next step is to add a collider to the root object of the car. I am going to use a capsule collider,
because it prevents the car from flipping on its back and force it to roll until it gets back
on its wheels. The capsule must extend from the back to the front of the car. Vertically, the
capsule must be raised so its bottom side touches the bottom side of the car body. Another
important modification we have to do is to increase the size of the colliders of front and
back axes. These colliders must be extended along the x axis until the ends of the colliders
reach the outer side of the wheels. The purpose of this collider extension is to prevent the
wheel collider from sinking into the ground accidentally (specially when the vehicle jumps
and lands on the wheels of one side), which may make the vehicle stuck with a wheel under
the ground. Illustration 54 shows the correct size and position of the collider.
Search WWH ::




Custom Search