Class CarEngineController
A pre-made controller to attach to your prefabs, this MonoBehaviour provides a way for controlling the car's engine, gearbox and wheels.
Namespace: YACC.Controllers
Assembly: .dll
Syntax
public class CarEngineController : MonoBehaviour
Remarks
This controller requires the new Unity Input System and some controls to be mapped beforehand, you can find more information and link to the documentation here: https://docs.unity3d.com/Manual/com.unity.inputsystem.html
Fields
Name | Description |
---|---|
acceleration | Sets the acceleration input value externally, useful if you want to command this prefab via CPU-controlled actors. |
actionRefAccelerate | |
actionRefBrake | The Input System Action reference for the brake input binding. |
actionRefShiftDown | The Input System Action reference for the shift down input binding. |
actionRefShiftUp | The Input System Action reference for the shift up input binding. |
actionRefSteer | The Input System Action reference for the steer input binding. |
brake | Sets the braking input value externally, useful if you want to command this prefab via CPU-controlled actors. |
engine | |
gearBox | |
speed | |
speedometer | |
steer | Sets the steering input value externally, useful if you want to command this prefab via CPU-controlled actors. |
steeringSmoothing | |
wheels |
Properties
Name | Description |
---|---|
controlledByPlayer |
Methods
Name | Description |
---|---|
CalculateOptimalGearShifts() | |
DisableInput() | |
EnableInput() | |
GetSpeedSign() |