WheelCollider
Class, inherits from Collider
A special collider for vehicle wheels.
Wheel collider is used to model vehicle wheels. It functions similar to the RaycastCollider,
but also has wheel physics and slip based tire friction model built in. In most cases
WheelCollider is more accurate and easier to use as well.
Wheel's collision detection is performed by casting a ray from center downwards the local
y-axis. The wheel has a radius and can extend downwards by suspensionDistance
amount.
The wheel is controlled with motorTorque, brakeTorque and steerAngle properties.
Wheel collider computes friction separately from the rest of physics engine, using a slip based
friction model. This allows for more realistic behaviour, but makes
wheel colliders ignore standard PhysicMaterial settings. Simulation of different road materials
is done by changing the forwardFriction and sidewaysFriction
based on what material the wheel is hitting. See Also: GetGroundHit and WheelFrictionCurve.
Variables
| center |
The center of the wheel, measured in the object's local space.
|
| radius |
The radius of the wheel, measured in local space.
|
| suspensionDistance |
Maximum extension distance of wheel suspension, measured in local space.
|
| suspensionSpring |
The parameters of wheel's suspension. The suspension attempts to reach a target position
|
| mass |
The mass of the wheel. Must be larger than zero.
|
| forwardFriction |
Properties of tire friction in the direction the wheel is pointing in.
|
| sidewaysFriction |
Properties of tire friction in the sideways direction.
|
| motorTorque |
Motor torque on the wheel axle. Positive or negative depending on direction.
|
| brakeTorque |
Brake torque. Must be positive.
|
| steerAngle |
Steering angle in degrees, always around the local y-axis.
|
| isGrounded |
Indicates whether the wheel currently collides with something (Read Only).
|
| rpm |
Current wheel axle rotation speed, in rotations per minute (Read Only).
|
Functions
Inherited members
Inherited Variables
Inherited Functions
Inherited Messages Sent
Inherited Class Functions
|
operator bool |
Does the object exist?
|
|
Instantiate |
Clones the object original and returns the clone.
|
|
Destroy |
Removes a gameobject, component or asset.
|
|
DestroyImmediate |
Destroys the object obj immediately. It is strongly recommended to use Destroy instead.
|
|
FindObjectsOfType |
Returns a list of all active loaded objects of Type type.
|
|
FindObjectOfType |
Returns the first active loaded object of Type type.
|
|
operator == |
Compares if two objects refer to the same
|
|
operator != |
Compares if two objects refer to a different object
|
|
DontDestroyOnLoad |
Makes the object target not be destroyed automatically when loading a new scene.
|
|