Customization

Table of Contents

RCCP's customization system lets players modify vehicles at runtime: paint color, wheels, spoilers, sirens, decals, neons, and performance upgrades. All customization is managed through the RCCP_Customizer component and its eight manager sub-components, with persistent save/load via PlayerPrefs and JSON serialization.

RCCP_Customizer Setup

Add the RCCP_Customizer component to your vehicle (it inherits from RCCP_Component). This is the central hub that coordinates all customization managers and handles save/load operations.

Key Properties

PropertyTypeDefaultDescription
saveFileNamestringVehicle nameUnique identifier for saving/loading this vehicle's customization. Auto-populated from the vehicle's GameObject name. Must be unique per vehicle if you want independent save slots.
autoInitializebooltrueAutomatically initializes all manager sub-components. Set to false for networked vehicles where you want to sync customization data manually.
autoLoadLoadoutbooltrueLoads the last saved customization loadout on Awake.
autoSavebooltrueAutomatically saves customization changes.
initializeMethodInitializeMethodStartControls when managers are initialized. Options: Awake, OnEnable, Start, DelayedWithFixedUpdate.

Initialization Timing

The InitializeMethod enum controls when all upgrade managers are initialized:

ValueWhenUse Case
AwakeDuring Awake()When customization must be ready before other components.
OnEnableDuring OnEnable()When re-enabling a pooled vehicle.
StartDuring Start()Default. Suitable for most scenarios.
DelayedWithFixedUpdateAfter one FixedUpdate frameWhen other physics components need to initialize first.

Basic API


RCCP_Customizer customizer = vehicle.GetComponentInChildren<RCCP_Customizer>();

// Manually initialize all managers
customizer.Initialize();

// Save the current customization state
customizer.Save();

// Load previously saved customization
customizer.Load();

// Delete saved data and restore defaults
customizer.Delete();

// Hide/show all visual upgrades (spoilers, sirens, decals, neons)
customizer.HideAll();
customizer.ShowAll();

Manager Components

The customizer delegates work to eight specialized manager components. Each manager handles one category of customization and is found automatically via GetComponentInChildren.

ManagerVisual ComponentCategory
RCCP_VehicleUpgrade_PaintManagerRCCP_VehicleUpgrade_PaintVehicle body color
RCCP_VehicleUpgrade_WheelManagerRCCP_VehicleUpgrade_WheelWheel model swapping
RCCP_VehicleUpgrade_SpoilerManagerRCCP_VehicleUpgrade_SpoilerRear spoilers
RCCP_VehicleUpgrade_SirenManagerRCCP_VehicleUpgrade_SirenPolice lights / sirens
RCCP_VehicleUpgrade_DecalManagerRCCP_VehicleUpgrade_DecalBody decals
RCCP_VehicleUpgrade_NeonManagerRCCP_VehicleUpgrade_NeonUnderglow neons
RCCP_VehicleUpgrade_UpgradeManager(see Performance Upgrades)Engine, brake, handling, speed
RCCP_VehicleUpgrade_CustomizationManager(see Tuning Data)Suspension, transmission, aids

Paint System

Components: RCCP_VehicleUpgrade_PaintManager / RCCP_VehicleUpgrade_Paint

The paint system applies a color to the vehicle body materials at runtime. The selected color is stored in the loadout as a Color value (alpha of 0 means no paint has been applied).

Use RCCP_ColorPickerBySliders for a ready-made UI color picker with RGB sliders.


// Apply a custom paint color
RCCP_VehicleUpgrade_PaintManager paintManager = customizer.PaintManager;
if (paintManager != null)
    paintManager.Initialize();  // Applies the color stored in the loadout

Wheel Customization

Components: RCCP_VehicleUpgrade_WheelManager / RCCP_VehicleUpgrade_Wheel

Wheel customization swaps the visual wheel models on all axles at runtime. Available wheel presets are defined in the RCCP_ChangableWheels ScriptableObject located in Resources/.

Each preset in RCCP_ChangableWheels contains a wheel prefab. The wheel index stored in the loadout (-1 means no custom wheels applied) maps to this array.

To add new wheel options:

  1. Open RCCP_ChangableWheels from Tools > BoneCracker Games > Realistic Car Controller Pro > Configuration > Wheels.
  2. Add your wheel prefab to the list.
  3. The new wheel is immediately available for selection at runtime.

Spoiler System

Components: RCCP_VehicleUpgrade_SpoilerManager / RCCP_VehicleUpgrade_Spoiler

Add or swap spoiler prefabs on the vehicle. Each RCCP_VehicleUpgrade_Spoiler component represents one spoiler option. The manager tracks which spoiler is active by index (-1 means none).

Siren / Police Lights

Components: RCCP_VehicleUpgrade_SirenManager / RCCP_VehicleUpgrade_Siren

Adds police-style flashing lights and optional siren audio to the vehicle. Uses the RCCP_PoliceLights component for the light animation. The siren index (-1 means none) identifies which siren preset is active.

Decals

Components: RCCP_VehicleUpgrade_DecalManager / RCCP_VehicleUpgrade_Decal

Applies decal graphics to the vehicle body using Unity's DecalProjector component. Supports up to 4 decal slots: front, back, left, and right. Each slot has its own index in the loadout (-1 means no decal applied).

Important: Decals require URP or HDRP. The DecalProjector component is not available in the built-in render pipeline. If you are using the built-in pipeline, decals will not be visible. See Render Pipelines for pipeline setup instructions.

Neons

Components: RCCP_VehicleUpgrade_NeonManager / RCCP_VehicleUpgrade_Neon

Adds underglow lighting effects beneath the vehicle using DecalProjector. The neon index (-1 means none) identifies which neon preset is active.

Important: Like decals, neons require URP or HDRP. They will not work with the built-in render pipeline. See Render Pipelines for pipeline setup instructions.

Performance Upgrades

Component: RCCP_VehicleUpgrade_UpgradeManager

Performance upgrades modify the vehicle's driving characteristics. Four upgrade categories are available, each with its own level (starting at 0 for stock):

UpgradeComponentEffect
EngineRCCP_VehicleUpgrade_EngineIncreases maximum engine torque output
BrakeRCCP_VehicleUpgrade_BrakeIncreases brake force for shorter stopping distances
HandlingRCCP_VehicleUpgrade_HandlingImproves suspension stiffness and steering response
SpeedRCCP_VehicleUpgrade_SpeedIncreases maximum achievable speed

The RCCP_VehicleUpgrade_UpgradeManager tracks the current level for each category:


RCCP_VehicleUpgrade_UpgradeManager upgradeManager = customizer.UpgradeManager;
if (upgradeManager != null) {
    int engineLevel = upgradeManager.EngineLevel;
    int brakeLevel = upgradeManager.BrakeLevel;
    int handlingLevel = upgradeManager.HandlingLevel;
    int speedLevel = upgradeManager.SpeedLevel;
}

Tuning Data (RCCP_VehicleUpgrade_CustomizationManager)

Component: RCCP_VehicleUpgrade_CustomizationManager

This manager handles detailed vehicle tuning stored in RCCP_CustomizationData. Unlike the other upgrade categories that use simple level integers, this stores the full set of tunable parameters:

Suspension

FieldTypeDefaultDescription
suspensionDistanceFrontfloat0.2Front axle travel distance in meters
suspensionDistanceRearfloat0.2Rear axle travel distance in meters
suspensionSpringForceFrontfloat55000Front spring force in Newtons
suspensionSpringForceRearfloat55000Rear spring force in Newtons
suspensionDamperFrontfloat3500Front damper force
suspensionDamperRearfloat3500Rear damper force
suspensionTargetFrontfloat0.5Front target position (0 = extended, 1 = compressed)
suspensionTargetRearfloat0.5Rear target position (0 = extended, 1 = compressed)

Camber and Transmission

FieldTypeDefaultDescription
cambersFrontfloat0Front wheel camber angle (-15 to 15 degrees)
cambersRearfloat0Rear wheel camber angle (-15 to 15 degrees)
gearShiftingThresholdfloat0.8Normalized RPM threshold for automatic gear shifts (0-1)
clutchThresholdfloat0.1Clutch engagement speed (0-1)

Stability Aids

FieldTypeDefaultDescription
counterSteeringbooltrueAutomatic counter-steering for oversteer recovery
steeringLimiterbooltrueLimit steering angle based on vehicle speed
ABSboolfalseAnti-lock Braking System
ESPboolfalseElectronic Stability Program
TCSboolfalseTraction Control System
SHboolfalseSteering Helper (velocity-aligned steering correction)
NOSboolfalseNitrous Oxide System
revLimiterboolfalseEngine rev limiter
automaticTransmissionboolfalseAutomatic transmission mode

Visual Settings

FieldTypeDefaultDescription
headlightColorColorWhiteCustom headlight color tint
wheelSmokeColorColorWhiteCustom tire smoke particle color

Loadout System

All customization state is stored in an RCCP_CustomizationLoadout instance, a serializable class that serves as the single source of truth for a vehicle's customization.

Loadout Fields

FieldTypeDefaultDescription
paintColorWhite (alpha 0)Vehicle body paint color. Alpha of 0 means no paint applied.
spoilerint-1Equipped spoiler index. -1 means none.
sirenint-1Equipped siren index. -1 means none.
wheelint-1Equipped wheel set index. -1 means none.
engineLevelint0Engine upgrade level. 0 is stock.
handlingLevelint0Handling upgrade level. 0 is stock.
brakeLevelint0Brake upgrade level. 0 is stock.
speedLevelint0Speed upgrade level. 0 is stock.
decalIndexFrontint-1Front decal index. -1 means none.
decalIndexBackint-1Back decal index. -1 means none.
decalIndexLeftint-1Left side decal index. -1 means none.
decalIndexRightint-1Right side decal index. -1 means none.
neonIndexint-1Neon underglow index. -1 means none.
customizationDataRCCP_CustomizationData(defaults)Detailed tuning data (suspension, aids, transmission).

How Save / Load Works

The customizer uses PlayerPrefs with JSON serialization:


// Saving: serializes the loadout to JSON and stores it in PlayerPrefs
PlayerPrefs.SetString(saveFileName, JsonUtility.ToJson(loadout));

// Loading: reads JSON from PlayerPrefs and deserializes to a loadout
loadout = JsonUtility.FromJson<RCCP_CustomizationLoadout>(
    PlayerPrefs.GetString(saveFileName)
);

The saveFileName is the PlayerPrefs key. Each vehicle must have a unique saveFileName to avoid overwriting another vehicle's data.

Loadout Update Flow

When any manager component changes a value, it calls loadout.UpdateLoadout(component) which uses a type-switch to copy the relevant data:

Customization UI

RCCP provides ready-made UI prefabs for customization screens, managed through the RCCP_CustomizationSetups ScriptableObject (located in Resources/RCCP_CustomizationSetups.asset).

UI Prefab References

The RCCP_CustomizationSetups singleton holds references to UI prefabs for each category:

FieldDescription
paintsPaint color selection UI panel
wheelsWheel selection UI panel
upgradesPerformance upgrade UI panel
spoilersSpoiler selection UI panel
sirensSiren/police light UI panel
decalsDecal selection UI panel
neonsNeon underglow UI panel
customizationSuspension and handling tuning UI panel

Key UI Components

ComponentDescription
RCCP_UI_CustomizerMain UI controller for the customization screen
RCCP_UI_CustomizationSliderSlider UI element for tuning parameters
RCCP_CustomizationTriggerCollider-based trigger zone that opens customization when the player drives in
RCCP_CustomizationStationDedicated customization area with camera positioning
RCCP_ColorPickerBySlidersRGB color picker with sliders for the paint system

Networking Considerations

For networked multiplayer vehicles:

  1. Set autoInitialize to false on remote vehicles.
  2. Sync the RCCP_CustomizationLoadout data across the network using your networking solution (Mirror, Photon, etc.).
  3. After receiving loadout data, call customizer.Initialize() manually to apply the customization.
  4. Do not use autoSave or autoLoadLoadout on remote vehicles since their state comes from the network, not from local PlayerPrefs.

Common Issues

Decals or neons not visible

Decals and neons use Unity's DecalProjector, which is only available in URP and HDRP. If you are using the built-in render pipeline, these features will not work. See Render Pipelines for migration instructions.

Loadout not saving or loading

Paint not applying

Wheels not changing

Customization not applied on spawn

Related Topics


Support: bonecrackergames@gmail.com | www.bonecrackergames.com

Need help? See Troubleshooting