CVR Wheel Hub Controller
Top-level vehicle brain. Sits on the vehicle’s root Rigidbody and distributes motor torque, brake torque, and steering angle across a list of CVR Wheel Controllers. Also supports skid steering for tanks/treads, passive “parking” brake, and default car controls when driven from a CVR Seat.
Rigid Body
Section titled “Rigid Body”Vehicle root Rigidbody. Forward speed is sampled as Vector3.Dot(transform.forward, velocity) each FixedUpdate.
Wheels
Section titled “Wheels”List of CVR Wheel Controllers this hub drives. At Start the hub sets managingHub on each one.
Config
Section titled “Config”Motor Torque
Section titled “Motor Torque”Maximum motor torque per wheel. Multiplied by Torque Curve (which is sampled against the current speed factor, 0–1). Default 200.
Brake Torque
Section titled “Brake Torque”Brake torque applied while braking. Default 200.
Max Speed Forward
Section titled “Max Speed Forward”Forward speed cap used to compute the speed factor. Default 20.
Max Speed Reverse
Section titled “Max Speed Reverse”Reverse speed cap used to compute the speed factor. Default 20.
Steering Range
Section titled “Steering Range”Maximum steer angle at stationary, in degrees. Default 30.
Steering Range At Max Speed
Section titled “Steering Range At Max Speed”Steer angle at max speed, in degrees — the effective range is lerped between this and Steering Range using the speed factor. Default 10.
Reverse Forward
Section titled “Reverse Forward”Treat -Z as “forward”. Flips the effective forward vector and accelerate sign.
Torque Curve
Section titled “Torque Curve”AnimationCurve sampled 0–1 against the current speed factor, multiplied into the motor torque. Default falls off from 1 at mid speed to 0 at max.
Input Accelerate
Section titled “Input Accelerate”Accelerate input [-1, 1].
Input Brake
Section titled “Input Brake”Brake input [0, 1].
Input Steering
Section titled “Input Steering”Steering input [-1, 1].
Use Default Car Controls
Section titled “Use Default Car Controls”When enabled and a CVR Seat with locked controls is occupied by the local player, the hub reads CVRInputManager.accelerate/brake/steering/handBrake.
Skid steering
Section titled “Skid steering”Use Skid Steering
Section titled “Use Skid Steering”Enables differential drive. Motor torque and brake torque are split between left and right sides instead of applied uniformly with steering.
Low Skid Steering Speed
Section titled “Low Skid Steering Speed”Speed below which the skid ratio is less than 1 (soften the turn at low speeds). Default 5.
Use Brake Turning
Section titled “Use Brake Turning”When enabled, skid steering uses braking rather than opposite torque to pull the inside track around.
Extras
Section titled “Extras”Counter Input Brake
Section titled “Counter Input Brake”When enabled, pressing forward while the vehicle moves backward (or vice versa) applies the brake instead of reverse throttle.
Use Passive Braking
Section titled “Use Passive Braking”When enabled and no input is applied, wheels whose Is Braking flag is true receive a speed-dependent brake so the vehicle doesn’t roll downhill.
Passive Braking Torque
Section titled “Passive Braking Torque”Brake torque applied when passive braking is active. Default 200.
Debug WASD Steering
Section titled “Debug WASD Steering”Editor-only flag used by the inspector for debugging.
Public API
Section titled “Public API”| Member | Description |
|---|---|
GetForwardSpeed() | Last sampled forward speed in m/s. |
GetSpeedFactor() | Current 0..1 speed factor against Max Speed Forward/Reverse. |
GetGrounded() | True if any managed wheel is currently grounded. |
TrySetControlSeat(seat) | Called by a CVR Seat to register itself as the control seat (first-come wins). |
RemoveControlSeat(seat) | Clears the registered control seat. |
Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRWheelHubController.cs