Game Development Reference
In-Depth Information
There is a bunch of interesting properties to deal with: the mass of the wheel is set to 15,
assuming that each wheel wights 30 kilograms (remember that we have inner and outer
collider for each wheel), the radius can be adjusted visually by calibrating its value until
the collider has the same size of the visual wheel, and the suspension distance is the length of
the suspension spring when it is fully extended and in our case it is 25 centimeters. Suspension
spring , forward friction , and sideways friction categories contain a number of values that have
to do with wheel damping and friction. Sometimes it takes a long time to calibrate these val-
ues, so I am not going to discuss their details. However, it is useful to read about them in Unity
documentation or other sources on the internet; in order to learn how to configure them accur-
ately to achieve the desired result. Finally, we need to position the colliders correctly, like in
Illustration 57.
Illustration 57: The correct positioning of the wheel colliders in the vehicle. The colliders are shown in white color
The vertical line of the collider in Illustration 57 represents the spring suspension distance
for each wheel collider. On the other hand, the circle shows the position of the collider
when the spring is completely pressed. Therefore, we must position the colliders so that
the lower end of the line is at the same level of the lowest part of the visual wheel. Before
moving on, make sure that the complete hierarchy of your vehicle matches the hierarchy in
Illustration 58.
Search WWH ::




Custom Search