CustomVehicleController

Method
Description

GetRigidbody()

Returns Rigidbody component used by the CustomVehicleController

GetCurrentCarStats()

GetCenterOfMass()

Returns Transform which represents the CenterOfMass of the vehicle.

GetVehiclePreset()

VehiclePartsPresetSO holds references the the parts Scriptable Objects and is not intended for modifications.

GetCustomizableSet()

VehiclePartsCustomizableSet holds references the the parts Scriptable Objects and is intended for modifications.

SetVehiclePresetSO(VehiclePartsPresetSO newPreset)

SetNewPartToCustomizableSet(IVehiclePart newPart, bool front = true)

RemoveForcedInduction()

Sets the ForcedInductionSO that the VehiclePartsCustomizableSet uses to null

RemoveNitrous()

Sets the NitrousSO that the VehiclePartsCustomizableSet uses to null

UpdateWheelsRadiusFromMeshes()

Will recalculate the radius of the wheels based on the MeshRenderer's size.

AddNitroCharge(float amount)

Add the provided "amount" to the boost amount the vehicle currently has. If the added amount exceeds the maximum boost amount the bottle can contain, it will overflow into the next bottle.

SetNewEnginePart(CustomEnginePart newPart)

EnableInput(bool enable)

Enables or disables the input that the input provider component produces. When the input provider is disabled, shifting, steering, handbraking are disabled and, if the gas input isn't 0, the brake input will be equal to 1.


Property | (type)
Description

UsePreset | bool

DrivetrainType | DrivetrainType

Sets the drivetrain type of the vehicle. Possible values:

RWD (Rear Wheel Drive). AWD (All Wheel Drive).

FWD (Front Wheel Drive)

TransmissionType | TransmissionType

Sets the transmission type of the vehicle. Affects the way the gears change.

Possible values:

Automatic.

Manual (user input only).

AerialControlsEnabled | bool

AerialControlsSensitivity | float

SteerAngle | float

Maximum steering angle in degrees

SteerSpeed | float

Time in which wheels will rotate to the "Steering Input" * "Maximum Steering Angle" angle. Wheels change their rotation linearly.

CenteringSpeed | float

Time in which wheels will rotate to their default state.

ForwardSlippingThreshold | float

SidewaysSlippingThreshold | float

Defines how much slipping is allowed until the wheel is considered to be sideways slipping.

The slipping amount is the property of every tire. It equals to

The amount of raycasts that go along the forward axis of the wheel with an offset from -radius to +radius.

VehiclePartsSetWrapper | VehiclePartsSetWrapper

Reference type field allows other classes to cache it and use the up-to-date parts scriptable objects. This class holds the parts that the vehicle is using either in the form of VehiclePartsPresetSO or a VehiclePartsCustomizableSet. This class has a static "OnAnyPresetChanged" event that triggers when any used part change in any vehicle occurs and a vehicle controller-specific "OnPartsChanged" event.

FrontAxles / RearAxles / SteerAxles | VehicleAxle[]

Arrays that hold the corresponding VehicleAxles. You can use the elements of these arrays to access the WheelController components, as an example, like this: FrontAxles[0].LeftHalfShaft.WheelController

Last updated