Game Development Reference
In-Depth Information
The best practice when using wheel colliders is to add an empty game object as a child
to the vehicle, and add all empty objects of the wheel colliders as children to it. Wheel
colliders in Unity have zero width, therefore, we need two colliders for each one of the
relatively wide wheels of our vehicle. One of these colliders must be positioned near the
outer side of the wheel, and the other near the inner side. To summarize, we need an empty
game object, and let's call it WheelColliders , and additional eight empty game objects ad-
ded to it, as in Listing 55.
Illustration 55: Empty objects to hold wheel colliders. The names of the objects describe
the position of the collider
After adding a wheel collider component to each one of the empty objects, we need to set their
properties. Refer to Listing 56 for the appropriate values for wheel colliders.
Search WWH ::




Custom Search