Class TyreWear
Simulates tire wear by progressively reducing grip based on slip and load over time. Integrates with StandardFriction to create a dynamic grip degradation system for endurance racing or long gameplay sessions.
Namespace: NWH.WheelController3D
Assembly: NWH.WheelController.dll
Syntax
[DisallowMultipleComponent]
[RequireComponent(typeof(StandardFriction))]
public class TyreWear : MonoBehaviour
Remarks
TyreWear accumulates damage from:
- Longitudinal slip (wheelspin, lock-ups)
- Lateral slip (cornering, drifting)
- Tire load (heavier loads cause faster wear)
As wear increases from 0 (new) to 1 (destroyed), the tire's grip is progressively reduced by modifying the StandardFriction's grip multipliers. At maximum wear, grip can be reduced by up to maxGripReduction (default 40%), making the vehicle increasingly difficult to control.
Use this component for:
- Endurance racing simulations
- Tire management gameplay mechanics
- Progressive difficulty increase over time
- Pit stop strategy implementations
Performance: Updates via coroutine at adjustable intervals (default 0.1s) to minimize overhead.
Fields
| Edit this page View SourcelateralSlipWearContribution
Weight factor for lateral (cornering) slip contribution to wear. Higher values make cornering and drifting wear tires faster.
Declaration
[Tooltip("Wear coefficient for lateral slip.")]
public float lateralSlipWearContribution
Field Value
| Type | Description |
|---|---|
| float |
Remarks
- 0.5-0.8: Reduced lateral wear (arcade, forgiving)
- 0.8-1.2: Balanced wear (default 1.0)
- 1.2-1.8: Increased lateral wear (drift/sim racing)
loadWearContribution
Weight factor for tire load contribution to wear. Higher values make heavily loaded tires (during braking/cornering) wear faster.
Declaration
[Tooltip("The effect of the load on the tire wear.")]
public float loadWearContribution
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Simulates how tire pressure and load affect wear rate. Heavy vehicles or high downforce setups will wear tires faster with higher values.
- 0.6-0.9: Reduced load sensitivity
- 0.9-1.1: Balanced (default 1.0)
- 1.1-1.5: Increased load sensitivity
longitudinalSlipWearContribution
Weight factor for longitudinal (accel/brake) slip contribution to wear. Higher values make wheelspin and lock-ups wear tires faster.
Declaration
[Tooltip("Wear coefficient for longitudinal slip.")]
public float longitudinalSlipWearContribution
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Affects wear from acceleration wheelspin and braking lock-ups.
- 0.5-0.8: Reduced longitudinal wear (forgiving)
- 0.8-1.2: Balanced wear (default 1.0)
- 1.2-1.8: Increased longitudinal wear (launch control/brake management important)
maxGripReduction
Maximum grip reduction at 100% wear (0-1 range). At full wear, grip is reduced by this fraction of the original value.
Declaration
[Tooltip("Grip coefficient at the 100% wear level.")]
public float maxGripReduction
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Example: 0.4 means at 100% wear, tires retain 60% of original grip.
- 0.2-0.3: Mild degradation (accessible gameplay)
- 0.3-0.5: Realistic degradation (default 0.4)
- 0.5-0.7: Severe degradation (simulation/challenge mode)
updateRate
How often (in seconds) the wear calculation updates. Lower values = more responsive but slightly higher CPU cost.
Declaration
[Range(0.01, 0.5)]
[Tooltip("Coroutine update frequency in seconds.")]
public float updateRate
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Default 0.1s (10 updates/second) is a good balance. Increase to 0.2-0.5s for performance on low-end hardware. Decrease to 0.05s for more immediate feedback.
wear
Current tire wear level: 0 = brand new, 1 = completely worn out. Read this value to display wear to the player or trigger pit stop logic.
Declaration
[Range(0, 1)]
[Tooltip("Current tire wear. 0 = no wear, 1 = fully worn.")]
public float wear
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Wear accumulates over time based on slip and load. Can be reset to 0 to simulate tire changes during pit stops. Monitor this value in race strategy code.
wearRate
Overall wear rate multiplier. Higher values make tires wear out faster. Adjust this to tune wear speed for your game's race length.
Declaration
[Tooltip("Wear rate coefficient. Unitless.")]
public float wearRate
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Unitless multiplier applied to all wear calculations.
- 0.001-0.005: Very slow wear (multiple hour races)
- 0.005-0.02: Moderate wear (30-60 min races, default 0.01)
- 0.02-0.1: Fast wear (short races, aggressive gameplay) Tweak based on typical race duration and desired pit stop frequency.