Vehicle Setup
Table of Contents
Vehicle Architecture
Every RCCP vehicle is built on a single root GameObject with the RCCP_CarController component. This acts as the central hub that lazy-loads and references all child components. The component system is modular — each subsystem (engine, gearbox, damage, etc.) lives on its own child GameObject and auto-registers with the parent controller.
Component Hierarchy
A typical RCCP vehicle looks like this in the Unity Hierarchy:
Vehicle (RCCP_CarController, Rigidbody)
├── RCCP_Engine
├── RCCP_Clutch
├── RCCP_Gearbox
├── RCCP_Differential
├── RCCP_Axles
│ ├── RCCP_Axle_Front
│ │ ├── WheelCollider_FL (RCCP_WheelCollider)
│ │ └── WheelCollider_FR (RCCP_WheelCollider)
│ └── RCCP_Axle_Rear
│ ├── WheelCollider_RL (RCCP_WheelCollider)
│ └── WheelCollider_RR (RCCP_WheelCollider)
├── RCCP_AeroDynamics
├── RCCP_Stability
├── RCCP_Input
├── RCCP_Audio
├── RCCP_Lights
├── RCCP_Particles
├── RCCP_Damage
├── RCCP_Customizer
├── RCCP_OtherAddons
│ ├── RCCP_Exhausts
│ ├── RCCP_Nos
│ ├── RCCP_FuelTank
│ ├── RCCP_Limiter
│ ├── RCCP_Recorder
│ ├── RCCP_BodyTilt
│ ├── RCCP_WheelBlur
│ ├── RCCP_Visual_Dashboard
│ └── RCCP_TrailerAttacher
└── Body (mesh renderers, colliders)
Component Base Classes
All vehicle components inherit from RCCP_Component, which provides:
- CarController — Lazy-loaded reference to the parent
RCCP_CarController - RCCPSettings — Access to the global
RCCP_SettingsScriptableObject - RCCPGroundMaterials — Surface friction and audio database
- RCCPSceneManager — The scene management singleton
Components auto-register with their parent RCCP_CarController when they initialize. Missing components are safe — accessing a component property that doesn't exist returns null rather than throwing an error.
The Included Prototype Vehicle
RCCP Lite ships with a fully configured prototype vehicle in the demo scene (RCCP_Scene_Blank_Prototype). This vehicle includes all drivetrain components, damage, customization, audio, particles, lights, and is AI-ready.
You can use this vehicle as-is for evaluation, or duplicate it to create variations.
RCCP_CarController (Main Hub)
The RCCP_CarController component is the entry point for all vehicle interaction. It exposes lazy-loaded properties for every subsystem:
Drivetrain Access
| Property | Type | Description |
|---|---|---|
Engine | RCCP_Engine | Power generation and RPM |
Clutch | RCCP_Clutch | Clutch engagement |
Gearbox | RCCP_Gearbox | Gear ratios and shifting |
Differentials | RCCP_Differential[] | Power distribution |
AxleManager | RCCP_Axles | Axle container |
FrontAxle | RCCP_Axle | Auto-detected front axle |
RearAxle | RCCP_Axle | Auto-detected rear axle |
AllWheelColliders | RCCP_WheelCollider[] | All wheel physics components |
System Access
| Property | Type | Description |
|---|---|---|
AeroDynamics | RCCP_AeroDynamics | Downforce and drag |
Stability | RCCP_Stability | ABS, ESP, TCS, helpers |
Inputs | RCCP_Input | Input processing |
Audio | RCCP_Audio | Sound system |
Lights | RCCP_Lights | Vehicle lighting |
Damage | RCCP_Damage | Damage and deformation |
Particles | RCCP_Particles | Particle effects |
Customizer | RCCP_Customizer | Paint, wheels, upgrades |
OtherAddonsManager | RCCP_OtherAddons | NOS, fuel, recorder, etc. |
Rigid | Rigidbody | Unity physics body |
Vehicle State
| Property | Type | Description |
|---|---|---|
speed | float | Current speed in km/h |
absoluteSpeed | float | Absolute speed value |
engineRPM | float | Current engine RPM |
currentGear | int | Active gear number |
canControl | bool | Player input enabled |
externalControl | bool | External controller active |
engineRunning | bool | Engine is running |
IsGrounded | bool | At least one wheel on ground |
direction | int | 1 = forward, -1 = reverse |
Editable in Lite
In the RCCP Lite inspector, the RCCP_CarController allows you to:
- Toggle
canControl(enable/disable player input) - Toggle
externalControl(flag for AI/scripted control) - Toggle
ineffectiveBehavior(ignore global behavior presets) - Navigate to any child component by clicking its icon
- Enable/disable individual components
Component creation and removal buttons are disabled in Lite.
Execution Order
RCCP uses Unity's [DefaultExecutionOrder] attribute to ensure components initialize in the correct sequence:
| Order | Components |
|---|---|
| -50 | RCCP_SceneManager, RCCP_InputManager, RCCP_SkidmarksManager |
| -10 | RCCP_CarController |
| -5 | RCCP_Axles, RCCP_Exhausts |
| 0 | All standard components (Engine, Gearbox, Stability, etc.) |
| +5 | RCCP_Camera |
| +10 | RCCP_BodyTilt, RCCP_Customizer, RCCP_Lod |
This ensures that managers initialize before vehicles, vehicles before components, and visual effects run last.
Next Steps
- 04_DrivetrainComponents.md — Detailed guide to each drivetrain component
- 05_VehicleSystems.md — Stability, damage, audio, and other systems
- 13_API.md — Controlling vehicles from code