Car Controller
A simple demo vehicle controller for showcasing WheelController. Provides basic arcade-style driving with steering, acceleration, braking, and handbrake. For production use or advanced features (powertrain, transmission, traction control, modules), use VehicleController.
Key Features
- Direct motor/brake torque application to wheels
- Speed-based steering angle interpolation
- Automatic braking when changing direction
- Unity Input System integration
- Per-wheel configuration (power, steer, handbrake)
- Inherits from
Vehiclebase class for compatibility with VehicleChanger and camera systems
Configuration
Torque Settings
- Max Motor Torque - Maximum motor torque applied to powered wheels. Default: 1000 Nm. High values can cause excessive wheel spin since powertrain is not simulated.
- Max Brake Torque - Maximum brake torque for braking and handbrake. Default: 3000 Nm.
Steering
- Max Steering Angle - Steering angle at low speeds (~0 m/s). Default: 35 degrees.
- Min Steering Angle - Steering angle at high speeds (~20 m/s). Default: 20 degrees. Interpolated based on vehicle speed to prevent instability.
Wheel Configuration
Each wheel in the wheels list has:
- Wheel Controller - Reference to the WheelController component
- Power - Apply motor torque to this wheel
- Steer - Apply steering angle to this wheel
- Handbrake - Apply handbrake torque to this wheel
Input
Uses Unity Input System with CarInputActions:
- Steering - Horizontal axis with smoothing (0.12s damping)
- Throttle - Vertical axis (forward/reverse)
- Handbrake - Space bar
Behavior Notes
- Auto-braking when input opposes current direction (e.g., throttle forward while reversing)
- Vehicle disabled when
Behaviour.enabled = falseto prevent FixedUpdate execution - No powertrain simulation - direct torque application only
- No differential - torque split depends on wheel configuration