This component implements the wheel colling entity in Unity 3D:
- Suspension, steering, physical contact
- Suspension analysis at the Inspector
- Comprehensive wheel gizmo at the Scene view
- Visual meshes for wheel, brake caliper and suspension geometry
The context menu option "Adjust position and radius to the Wheel mesh" at the VPWheelCollider component automatically calculates position, radius and center to match the visual Wheel mesh specified at Visual Objects.
The mass should be roughly the mass of the wheel.
The radius should match the actual radius of the wheel mesh.
The inertia is calculated as
Position offset to the center of the wheel.
VPWheelCollider component should be placed in the same position as its corresponding visual
Wheel transform (but not in the same hierarchy, see Visual Objects below). Then
the center property is used to match the actual position of the wheel.
The best position for the wheel collider's center is the outer part of the wheel. It provides better accuracy and stability.
- Distance (m)
- Length of the suspension travel.
- Anchor (%)
- Relative position in the suspension travel (compression) where the wheel is located at design time. This setting can be understood easily by adjusting it in the Editor and watching the gizmo in the Scene view.
- Spring rate (
Springs sustain the weight of the vehicle. The inspector shows the maximum force and weight the spring can support right before hitting the limit.
As rule of thumb, configure the spring rate so each suspension can support up to twice of the evenly distributed weight.
- Damper rate (
Dampers limit the suspension movement and damp the spring oscillations. The damper setup affects the angular momentum of the vehicle on weight shifting situations (accelerating, braking, cornering...).
Dampers are very badly implemented in PhysX 3 / Unity 5. A damper value too high will surely cause weird behaviors and unnatural reactions. Learn more
Suspension analysis tool
Expand the "Analysis" section under the Suspension settings of the VPWheelCollider component (select any wheel collider in your vehicle's hierarchy):
The suspension analysis tool doesn't have effect on the actual suspension behavior. It just calculates the suspension data based on the given compression ratio at rest.
- Play the scene and ensure the vehicle is at rest.
- Watch the telemetry for the compression ratio for the wheel you want to analyze.
- Specify that compression ratio in the analysis tool. It computes and shows the resulting values.
Read how suspensions work for interpreting and understanding the values.
These are the transforms for the visual objects representing the actual wheel and suspension components. They will be positioned and/or rotated according to the state of the wheel.
Visual objects (Suspension, Caliper, Wheel) must reside in a different sub-hierarchy than the VPWheelColliders inside the vehicle GameObject. Check out how a vehicle is created from scratch for details on how to build the vehicle hierarchy correctly.
- Moves vertically as for the suspension compression.
- Moves vertically as for the suspension compression and rotates around the Y axis as for the steering.
- Moves vertically as for the suspension compression, rotates around the Y axis as for the steering, and rotates around the X axis as for the wheel's angular velocity.
Suspension, Caliper and Wheel transform can be parented together in any way. They will be moved and rotated correctly.