Class VehicleAuthoring
Authoring component for vehicles
Inherited Members
Namespace: Unity.Vehicles
Assembly: com.unity.vehicles.dll
Syntax
[DisallowMultipleComponent]
public class VehicleAuthoring : MonoBehaviour
Fields
AxlePairedWheels
Array of wheel pairs belonging to the same axle. A pair consists of a left and a right wheel, in that order.
Declaration
[Tooltip("Array of wheel pairs belonging to the same axle. A pair consists of a left and a right wheel, in that order.")]
public PairedWheels[] AxlePairedWheels
Field Value
Type | Description |
---|---|
PairedWheels[] |
ContactSurfaceNormalAngleThreshold
Angle threshold for collision smoothing between the vehicle and mesh colliders.
If, at a given contact point between the vehicle and a mesh collider, the angle between the contact normal and the mesh surface normal is larger than this threshold and does not exceed 90 degrees minus this threshold, the normal of the corresponding contact will be set to the surface normal, ensuring smooth collisions with the terrain surface.
Declaration
[Tooltip("Angle threshold for collision smoothing between the vehicle and mesh colliders.\n\nIf, at a given contact point between the vehicle and a mesh collider, the angle between the contact normal and the mesh surface normal is larger than this threshold and does not exceed 90 degrees minus this threshold, the normal of the corresponding contact will be set to the surface normal, ensuring smooth collisions with the terrain surface.")]
public float ContactSurfaceNormalAngleThreshold
Field Value
Type | Description |
---|---|
float |
Dimensions
Dimensions of the vehicle, expressed in m. Used to scale certain value thresholds in vehicle code. May also be used for aerodynamics calculations if the Vehicle Control component is used.
Declaration
[Tooltip("Dimensions of the vehicle, expressed in m. Used to scale certain value thresholds in vehicle code. May also be used for aerodynamics calculations if the Vehicle Control component is used.")]
public float3 Dimensions
Field Value
Type | Description |
---|---|
float3 |
DimensionsDebugCenter
Local center position of the Dimensions gizmo
Declaration
[Tooltip("Local center position of the Dimensions gizmo")]
public float3 DimensionsDebugCenter
Field Value
Type | Description |
---|---|
float3 |
HardTerrainFeatureAngleThreshold
Angle threshold for detecting hard terrain features, for which no smoothing should be applied.
Corresponds to a threshold on the delta angle between the inverted vehicle's velocity at a given contact point and the colliding terrain feature's surface normal. Any surface feature leading to a delta angle that is larger than the threshold will be considered a hard terrain feature and contacts with this feature will not be filtered, ensuring collisions with hard terrain features are retained, enabling accurate collision response.
Declaration
[Tooltip("Angle threshold for detecting hard terrain features, for which no smoothing should be applied.\n\nCorresponds to a threshold on the delta angle between the inverted vehicle's velocity at a given contact point and the colliding terrain feature's surface normal. Any surface feature leading to a delta angle that is larger than the threshold will be considered a hard terrain feature and contacts with this feature will not be filtered, ensuring collisions with hard terrain features are retained, enabling accurate collision response.")]
public float HardTerrainFeatureAngleThreshold
Field Value
Type | Description |
---|---|
float |
SubstepCount
Number of slices the vehicle physics will slice one physics frame into. Higher values should be used to achieve stiffer friction and better high speed handling.
Declaration
[Range(4, 32)]
[Tooltip("Number of slices the vehicle physics will slice one physics frame into. Higher values should be used to achieve stiffer friction and better high speed handling.")]
public int SubstepCount
Field Value
Type | Description |
---|---|
int |
UseContactFiltering
Enables contact filtering for smoothing collisions between the vehicle and mesh colliders representing a terrain surface.
Declaration
[Tooltip("Enables contact filtering for smoothing collisions between the vehicle and mesh colliders representing a terrain surface.")]
public bool UseContactFiltering
Field Value
Type | Description |
---|---|
bool |
Wheels
Array holding the wheels belonging to this vehicle in the front left, front right, rear left, rear right, etc. order.
Declaration
[Tooltip("Array holding the wheels belonging to this vehicle in the front left, front right, rear left, rear right, etc. order.")]
public WheelAuthoring[] Wheels
Field Value
Type | Description |
---|---|
WheelAuthoring[] |
Methods
OnAutoDetectWheels()
Auto detect wheels
Declaration
public void OnAutoDetectWheels()