Public Methods
Method
Description
SetVehicleSettings()
Updates the vehicle settings from the VehicleSettings ScriptableObject. Called in Awake() and from the update button located on the component in the inspector.
ControlAcceleration()
Makes the vehicle move forward, use this to call forward movement from your input class.
ControlBrake()
Makes the vehicle brake, or reverse, use this to call backwards movement from your input class.
ControlTurning(int)
Controls the turning of the vehicle, and takes in an int to determine the direction. -1 for left 1 for right
SetPosition(Vector3, Quaternion)
Used to reposition and rotate the vehicle, best used for respawning. Pass in a Vector3 for the new position and a Quaternion for the rotation.
MovementPenalty(float)
Used to change the MaxSpeed of the vehicle. Example use: slowing down on grass.
SteeringPenalty(float)
Used to change the Steering speed of the vehicle. Example use: making it harder to turn on grass.
Jump(float, ForceMode = ForceMode.Impulse)
Make the vehicle jump, pass in a force big enough to get it off the ground at the height you want. ForceMode is optional, uses Impulse by default.
Added in v1.16
Boost()
Used to set the vehicle boosting, changes isBoosting to true.
OneShotBoost(float)
Performs a boost over a set amount of time (in seconds).
StopBoost()
Changes isBoosting to false returning the vehicle to MaxSpeed.
Last updated