Class Wheel
Namespace: YACC
Assembly: .dll
Syntax
[Serializable]
public class Wheel
Fields
| Name | Description |
|---|---|
| brakePower | The brake power applied to the wheel. This should be specified in Newton Meters. |
| gameObject | Reference to the game object that contains the wheel collider. |
| inverseSteering | If enabled the wheel will counter-steer. |
| isPowered | Defines if this wheel is powered. |
| isSteering | Defines if this wheel is a steering wheel. |
| steerAngleMax | The angle of the wheel when the steering is set to 1. This should be specified in degrees. |
Properties
| Name | Description |
|---|---|
| brake | The brake power applied to the wheel. This should be specified in a float range from 0 to 1. The brake power is multiplied by the brakePower property set in this wheel. |
| isGrounded | Defines if this wheel is grounded. |
| radius | Retrieves the radius of the wheel collider. |
| rpm | Retrieves the current RPM of the wheel collider. |
| steer | The steering angle of the wheel. This should be specified in a float range from -1 to 1. The steering angle is multiplied by the steerAngleMax property set in this wheel. |
| torque | The torque applied to the wheel axle. This should be specified in Newton Meters. |
Methods
| Name | Description |
|---|---|
| Awake() | Call this from your Awake method in your controller, this will initialize the wheel collider and move the wheel mesh in a child game object. |
| OnValidate() | Validates the wheel setup and wheel colliders. Call this from your OnValidate method in your controller. |
| Update() | Updates the wheel mesh position and rotation. |