unity3d Collision Wheel Collider


The wheel collider inside unity is built upon Nvidia's PhysX wheel collider, and therefore shares many similar properties. Technically unity is a "unitless" program, but to make everything make sense, some standard units are required.

Basic Properties

  • Mass - the weight of the wheel in Kilograms, this is used for wheel momentum and the moment of interia when spinning.
  • Radius - in meters, the radius of the collider.
  • Wheel Damping Rate - Adjusts how "responsive" the wheels are to applied torque.
  • Suspension Distance - Total travel distance in meters that the wheel can travel
  • Force App Point Distance - where is the force from the suspension applied to the parent rigidbody
  • Center - The center position of the wheel

Suspension Settings

  • Spring - This is the spring constant, K , in Newtons/meter in the equation:

Force = Spring Constant * Distance

A good starting point for this value should be the total mass of your vehicle, divided by the number of wheels, multiplied by a number between 50 to 100. E.g. if you have a 2,000kg car with 4 wheels, then each wheel would need to support 500kg. Multiply this by 75, and your spring constant should be 37,500 Newtons/meter.

  • Damper - the equivalent of a shock absorber in a car. Higher rates make the suspense "stiffer" and lower rates make it "softer" and more likely to oscillate.
    I do not know the units or equation for this, I think it it has to do with a frequency equation in physics though.

Sideways Friction Settings

The friction curve in unity has a slip value determined by how much the wheel is slipping (in m/s) from the desired position vs. the actual position.

  • Extremum Slip - This is the maximum amount (in m/s) a wheel can slip before it should lose traction

  • Extremum Value - This is the maximum amount of friction that should be applied to a wheel.

The values for Exrtremum Slip should be between .2 and 2m/s for most realistic cars. 2m/s is about 6 feet per second or 5mph, which is a lot of slip. If you feel that your vehicle needs to have a value higher than 2m/s for slip, you should consider increasing max friction (Extremum Value).

Max Fraction(Extremum Value) is the friction coefficient in the equation:

Force of Friction(in newtons) = Coefficient of Friction * Downward Force(in newtons)

This means with a coefficient of 1, you are applying the entire force of the car+suspension opposite of the slip direction. In real world applications, values higher than 1 are rare, but not impossible. For a tire on dry asphalt, values between .7 and .9 are realistic, so the default of 1.0 is preferable.

This value should not realistically not exceed 2.5, as strange behavior will begin to occur. E.g. you start to turn right, but because this value is so high, a large force is applied opposite of your direction, and you begin to slide into the turn instead of away.

If you have maxed both values, you should then begin to raise the asymptote slip and value. Asymptote Slip should be between .5 and 2 m/s, and defines the coefficient of friction for any slip value past the Asymptote slip. If you find your vehicles behaves well until it break traction, at which point it acts like it is on ice, you should raise the Asymptote value. If you find that your vehicle is unable to drift, you should lower the value.

Forward Friction

Forward friction is identical to sideways friction, with the exception that this defines how much traction the wheel has in the direction of motion. If the values are too low, you vehicles will do burnouts and just spin the tires before moving forward, slowly. If it is too high, your vehicle may have a tendency to try and do a wheely, or worse, flip.

Additional Notes

Do not expect to be able to create a GTA clone, or other racing clone by simply adjusting these values. In most driving games, these values are constantly being changed in script for different speeds, terrains, and turning values. Additionally, if you are just applying a constant torque to the wheel colliders when a key is being pressed, your game will not behave realistically. In the real world, cars have torque curves and transmissions to change the torque applied to the wheels.

For best results, you should tune these values until you get a car the responds reasonably well, and then make changes to wheel torque, max turning angle, and friction values in script.

More information about wheel colliders can be found in Nvidia's documenation: http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/Vehicles.html