Table of Contents

Wheel Controller 3D Manual


Setup

For WC3D to work properly, the vehicle model should have Unity-correct rotation and [1,1,1] scale. More about that here.

Vehicle Model

Wheels

Car Controller

If using the WheelController3D standalone asset, use the provided CarController script. Otherwise, if using it as a part of the NWH Vehicle Physics 2 asset skip to the VehicleController quick start guide.

The included barebones car controller that can use both WheelController and WheelCollider (through WheelColliderUAPI). Note that this controller is intended for demoing the wheels, and is not trying to be a fully-fledged car controller.
Variable Center of Mass

If the collider added previously is small (in relation to the size of the vehicle) or offset, Variable Center of Mass script can be used to adjust the center of mass and inertia values of the vehicle.

Typical center of mass on a vehicle (yellow sphere, CoM).

Adjusting the Behaviour

If you have no knowledge of how suspension works I would recommend checking out this link first. Also, check out FrictionPreset page.

Tips
Caster adjustment through the WheelController Transform rotation.
Reducing Roll
Center of Mass (yellow sphere) and Force Application Point (red sphere) on a vehicle. As long as the center of mass is above the force application point, the vehicle will lean towards the left corner, with the effect being larger the larger the distance is. Using center of mass that is below the force application point is not recommended because it will cause the vehicle to lean in the opposite direction of what is normally expected.
Achieving Oversteer
Arcade-like Behavior

By default the asset is geared towards realism. To achieve arcade-like behavior:


Considerations

While WheelController is quite flexible, there are a few things to keep in mind when designing a game around it. Most of these points apply to any wheel collider/controller that uses the inverse kinematics approach to wheel positioning, which positions the wheel on the ground and then calculates suspension forces. This approach results in excellent performance, stability, and reliability. Keep the following considerations in mind:

Field Explanations

Wheel

Wheel settings tab.

Suspension

Suspension settings tab.

Suspension settings are fully based on physics, so the general car suspension principles also apply here.

For best results, it is recommended to have the spring length higher than the Project Settings > Time > Fixed Delta Time setting. Lower values, or even 0, are supported but might result in bottoming out of the suspension which will result in a harsh and jumpy ride over bumps. The state of the suspension can be seen under the Debug tab during runtime (bottomed out / normal / fully extended).

Spring
Damper
General

Friction

Friction settings tab.

All the friction-related settings are under this tab.

Friction Preset

FrictionPreset is a ScriptableObject containing data about the friction properties of a tire.

WheelController's friction is slip-based. Tire always has some slip but it is very small under normal conditions – always near the left side of the curve below.

Image above shows friction curve with slip on the X axis and friction on the Y axis. Part of the curve on the left side marked as “has traction” is where tires normally operate, and part on the right side is where the tire lost traction. Depending on the shape of the curve vehicle will act differently upon losing traction. Here are parameters of the curve and how they affect handling:

  • B (stiffness) – With higher value curve will be faster to reach peak value meaning it will be steeper. This means that wheel will require less slip to lose traction and such vehicle will be more unstable – i.e. spin out more easily. With lower values of stiffness vehicle will be more stable and harder to spin but with very low value it will start to act as if on ice.

  • C (shape) – While stiffness determines where the peak will be, shape determines how strong the knee in the curve will be. High shape value will make it pointy while low value will make it flatter.
  • D (peak) – The higher it is the more traction wheel will have. It does exactly the same thing as Slip Coefficient field does. To simplify, resultant friction is equal to peak value times slip coefficient times some other values - this means that if peak is set to 0.5 and slip coefficient to 2 result will be exactly the same as if both were set to 1 since 0.5*2=1*1.
  • E (falloff) - Determines how fast curve will fall off after the peak. It depends on other parameters but in general lower value will mean that curve ends closer to 0, and value of 1 will mean that it is almost horizontal after the peak. If set to low value vehicle will start to slide once traction is lost and if set to high value there will be almost no difference between “has traction” and “lost traction” parts of the curve.
2023/05/14 16:35
Friction Circle
Friction Coefficients

Misc

Misc settings tab.

A collection of unsorted fields and actions.

Actions
Mutliplayer
Rendering
Layers
Other

Debug

Debug settings tab.

An overview of the WheelController values. It can be helpful in setting up the suspension travel or checking if the suspension bottomed out when going over a bump or landing a jump.

As always, the debug values can also be seen through right clicking the Inspector tab and switching the inspector into the Debug mode.