Class WheelAuthoring
Authoring component for wheels
Inherited Members
Namespace: Unity.Vehicles
Assembly: com.unity.vehicles.dll
Syntax
[DisallowMultipleComponent]
public class WheelAuthoring : MonoBehaviour
Fields
AddWheelProtectorCollider
Should the wheel protector collider for this wheel be added to the vehicle rigidbody? This collider represents the wheel at full suspension compression, and is used to handle suspension bottoming out and impacts from directions that are not handled by the suspension.
Declaration
[Tooltip("Should the wheel protector collider for this wheel be added to the vehicle rigidbody? This collider represents the wheel at full suspension compression, and is used to handle suspension bottoming out and impacts from directions that are not handled by the suspension.")]
public bool AddWheelProtectorCollider
Field Value
Type | Description |
---|---|
bool |
AntiRollBarStiffness
Maximum force the anti-roll bar can exert on one side of the suspension, in an attempt to reduce the body roll. Correctly adjusting the center of mass position should be the first step to addressing the body roll.
Declaration
[Tooltip("Maximum force the anti-roll bar can exert on one side of the suspension, in anattempt to reduce the body roll. Correctly adjusting the center of mass position should be the first step to addressing the body roll.")]
public float AntiRollBarStiffness
Field Value
Type | Description |
---|---|
float |
FrictionCircleStrength
Determines how much the longitudinal slip affects the lateral friction. Wheels with value of 1 will have no lateral friction when the wheel is locked or there is wheel spin.
Declaration
[Range(0, 1)]
[Tooltip("Determines how much the longitudinal slip affects the lateral friction. Wheels with value of 1 will have no lateral friction when the wheel is locked or there is wheel spin.")]
public float FrictionCircleStrength
Field Value
Type | Description |
---|---|
float |
FrictionCurve
Friction curve. X represents slip and Y represents the grip coefficient.
Declaration
[Header("Friction")]
[Tooltip("Friction curve. X represents slip and Y represents the grip coefficient.")]
public WheelAuthoring.FrictionCurveData FrictionCurve
Field Value
Type | Description |
---|---|
WheelAuthoring.FrictionCurveData |
Mass
Mass of the wheel, expressed in kg. The mass of the wheel affects only its angular inertia, which determines how long the wheel takes to spin up. Unrealistically small values can cause the simulation to require more sub-steps or result in rotational jitter when the vehicle is stationary.
Declaration
[Tooltip("Mass of the wheel, expressed in kg. The mass of the wheel affects only its angular inertia, which determines how long the wheel takes to spin up. Unrealistically small values can cause the simulation to require more sub-steps or result in rotational jitter when the vehicle is stationary.")]
public float Mass
Field Value
Type | Description |
---|---|
float |
Radius
Radius of the wheel, expressed in m. Not affected by the scale.
Declaration
[Tooltip("Radius of the wheel, expressed in m. Not affected by the scale.")]
public float Radius
Field Value
Type | Description |
---|---|
float |
SuspensionDampingRate
Combined bump and rebound setting for the suspension damper. Determines how much the suspension will resist changes in suspension length. Higher values will result in a suspension more resistant bouncing and bobbing, but a too high value will reduce the effectiveness of the suspension.
Declaration
[Tooltip("Combined bump and rebound setting for the suspension damper. Determines how much the suspension will resist changes in suspension length. Higher values will result in a suspension more resistant bouncing and bobbing, but a too high value will reduce the effectiveness of the suspension.")]
public float SuspensionDampingRate
Field Value
Type | Description |
---|---|
float |
SuspensionMaxLength
Maximum suspension travel / extension, expressed in m. For best suspension behavior the recommended length is more than the travel expected per one physics update, or the vehicle might bottom out frequently - which is when the suspension runs out of travel and the hard collision through a physics collider takes over. It is usually better to have more travel, and to adjust the vehicle ride height by adusting the suspension position instead.
Declaration
[Header("Suspension")]
[Tooltip("Maximum suspension travel / extension, expressed in m. For best suspension behavior the recommended length is more than the travel expected per one physics update, or the vehicle might bottom out frequently - which is when the suspension runs out of travel and the hard collision through a physics collider takes over. It is usually better to have more travel, and to adjust the vehicle ride height by adusting the suspension position instead.")]
public float SuspensionMaxLength
Field Value
Type | Description |
---|---|
float |
SuspensionSpringRate
Spring rate expressed in N/mm. Ideally this value would be set so that at rest, on flat ground, the suspension is about 30% compressed under the vehicle's own weight. Too low value and the vehicle will have less available suspension travel. Too high value and the vehicle will have little suspension travel available in extension, resulting in a wheel that loses contact with the ground easily.
Declaration
[Tooltip("Spring rate expressed in N/mm. Ideally this value would be set so that at rest, on flat ground, the suspension is about 30% compressed under the vehicle's own weight. Too low value and the vehicle will have less available suspension travel. Too high value and the vehicle will have little suspension travel available in extension, resulting in a wheel that loses contact with the ground easily.")]
public float SuspensionSpringRate
Field Value
Type | Description |
---|---|
float |
VisualSuspensionSharpness
Sharpness of the wheel visual movement along the suspension. The higher the value, the less visual smoothing there will be.
Declaration
[Tooltip("Sharpness of the wheel visual movement along the suspension. The higher the value, the less visual smoothing there will be.")]
public float VisualSuspensionSharpness
Field Value
Type | Description |
---|---|
float |
WheelColliderLayerOverrides
Layer overrides for the generated wheel collider. This will affect both wheel collider cast queries, and wheel protector contacts generation if the AddWheelProtectorCollider option is enabled.
Declaration
[Tooltip("Layer overrides for the generated wheel collider. This will affect both wheel collider cast queries, and wheel protector contacts generation if the 'AddWheelProtectorColliders' option is enabled.")]
public WheelColliderLayerOverrides WheelColliderLayerOverrides
Field Value
Type | Description |
---|---|
WheelColliderLayerOverrides |
WheelColliderSideCount
Number of sides the cylinder used for wheel cast will have. Minimum adequate value for the use case is recommended as this has a high impact on performance.
Declaration
[Header("Wheel Collider")]
[Tooltip("Number of sides the cylinder used for wheel cast will have. Minimum adequate value for the use case is recommended as this has a high impact on performance.")]
public int WheelColliderSideCount
Field Value
Type | Description |
---|---|
int |
WheelProtectorColliderPhysicsMaterial
Physics material for the generated wheel collider. This only matters if AddWheelProtectorCollider option is enabled.
Declaration
[Tooltip("Physics material for the generated wheel collider. This only matters if the 'AddWheelProtectorColliders' option is enabled.")]
public PhysicsMaterial WheelProtectorColliderPhysicsMaterial
Field Value
Type | Description |
---|---|
PhysicsMaterial |
WheelProtectorColliderProvidesContacts
Whether or not the wheel collider provides contacts. This only matters if the AddWheelProtectorCollider option is enabled.
Declaration
[Tooltip("Whether or not the wheel collider provides contacts. This only matters if the 'AddWheelProtectorColliders' option is enabled.")]
public bool WheelProtectorColliderProvidesContacts
Field Value
Type | Description |
---|---|
bool |
WheelSpinObject
Object that will be rotated in order to represent wheel spin.
Declaration
[Header("General")]
[Tooltip("Object that will be rotated in order to represent wheel spin.")]
public GameObject WheelSpinObject
Field Value
Type | Description |
---|---|
GameObject |
Width
Width of the wheel, expressed in m.
Declaration
[Tooltip("Width of the wheel, expressed in m.")]
public float Width
Field Value
Type | Description |
---|---|
float |