Customization

The Customization system lets your player modify a vehicle at runtime — paint color, spoilers, wheels, decals, neon underglow, sirens, suspension stiffness, camber, and engine / brake / handling / speed level upgrades. State persists automatically via PlayerPrefs so the player's customizations survive across sessions.

This document covers how to enable customization on a vehicle, how each sub-manager works, how to add your own paints / spoilers / wheels, and how to call customization from code.

What the Customization System Provides

The customizer is a collection of sub-managers, each handling one customization category. They are:

Sub-Manager What It Customizes
PaintManager Body paint color.
WheelManager Wheel rim models.
SpoilerManager Spoiler attachment.
DecalManager Decals on hood / roof / sides.
NeonManager Underglow neon lights.
SirenManager Police-style siren styles.
UpgradeManager Engine / brake / handling / speed level upgrades.
CustomizationManager Camber, toe, suspension stiffness, etc. — per-wheel tuning.

Each sub-manager is optional. A vehicle that only supports paint customization just has the PaintManager and skips the rest.

Enabling Customization on a Vehicle

Step 1 — Add the RCC_Customizer Root

Open your vehicle prefab. On the root GameObject, click Add Component and add RCC_Customizer.

Step 2 — Add Sub-Manager Children

For each customization category you want, add a child GameObject under the vehicle and add the matching component:

The root RCC_Customizer finds these children automatically via GetComponentsInChildren.

Step 3 — Configure Each Sub-Manager

Each sub-manager has its own configuration (described below). For minimum setup, the PaintManager just needs a list of paint locations on the body — the colors are picked at runtime.

Paint Manager

The PaintManager drives the body color of selected paint targets (the body mesh's material, plus optional sub-materials for hood, roof, side panels).

Setup

  1. Add RCC_Customizer_PaintManager as a child of the vehicle.
  2. In the Inspector, assign Paint Targets — the Renderer references for body, hood, roof, etc.
  3. Set Default Color — the color the vehicle starts with.

Runtime

RCC_Customizer customizer = vehicle.GetComponentInChildren<RCC_Customizer>();
customizer.PaintManager.Paint(new Color(1f, 0f, 0f)); // red

The change is immediate and is saved to PlayerPrefs.

Multi-Layer Paint

For vehicles with separate paint layers (e.g., the hood and roof painted independently from the body):

  1. In the Inspector, expand the Paint Targets list.
  2. Add one entry per paintable area.
  3. At runtime, paint each independently:
customizer.PaintManager.PaintLayer(0, Color.blue);  // body
customizer.PaintManager.PaintLayer(1, Color.white); // hood

(Exact API may vary — check the RCC_Customizer_PaintManager.cs file for the method signatures in your version.)

Wheel Manager

The WheelManager lets you swap the rim model on a vehicle.

Setup

  1. Add RCC_Customizer_WheelManager as a child.
  2. The available wheels are loaded from Resources/RCC Assets/RCC_ChangableWheels.asset — a ScriptableObject with an array of wheel prefab references.

Adding New Wheels

  1. Create a wheel prefab in Assets/RealisticCarControllerV4/Prefabs/Wheels/ (or any folder).
  2. Open RCC_ChangableWheels.asset.
  3. Add your prefab to the wheels[] array.
  4. Save.

The wheel prefab should be just the rim model — a tire mesh is usually included on the prefab as well.

Runtime

customizer.WheelManager.SetWheel(2); // index into RCC_ChangableWheels.wheels

The active wheel index saves to PlayerPrefs and is restored on next vehicle spawn.

Spoiler Manager

The SpoilerManager attaches or removes a spoiler from the back of the vehicle.

Setup

  1. Add RCC_Customizer_SpoilerManager as a child.
  2. Assign the Spoiler Attach Point — an empty Transform on the back of the vehicle where the spoiler should be parented.
  3. Add available spoiler prefabs to the Spoilers array.

Runtime

customizer.SpoilerManager.SetSpoiler(0);  // first spoiler
customizer.SpoilerManager.SetSpoiler(-1); // remove spoiler

Decal Manager

The DecalManager applies decal materials to fixed decal locations on the vehicle body (hood, sides, roof).

Setup

  1. Add RCC_Customizer_DecalManager as a child.
  2. Each decal location is a quad sub-mesh on the vehicle body, mapped to a separate material slot. Configure the Decal Targets array to point to those material slots.
  3. Add available decal materials to the Decals array.

Runtime

customizer.DecalManager.SetDecal(slotIndex: 0, decalIndex: 5);

Neon Manager

The NeonManager adds an underglow neon light effect to the bottom of the vehicle.

Setup

  1. Add RCC_Customizer_NeonManager as a child.
  2. Assign the Neon Material — a special emissive material that's positioned under the vehicle.
  3. Assign neon color options in the Colors array.

Runtime

customizer.NeonManager.SetNeonColor(Color.magenta);
customizer.NeonManager.EnableNeon(true);

Siren Manager

For police-style vehicles, the SirenManager toggles flashing red/blue lights and optionally a siren audio loop.

Setup

  1. Add RCC_Customizer_SirenManager as a child.
  2. Add an RCC_PoliceSiren component or reference to the sub-manager.
  3. Configure available siren styles (color combinations, flash patterns).

Runtime

customizer.SirenManager.SetSiren(true);   // turn on
customizer.SirenManager.SetSirenStyle(2); // change style

Upgrade Manager

The UpgradeManager handles four upgrade categories, each with a level (0 = base, higher = more upgraded). It applies the cumulative effect to the vehicle's stats at runtime.

Category What It Affects
Engine maxEngineTorque — each level increases torque by a configurable amount.
Brake brakeTorque — each level increases brake force.
Handling Friction stiffness — each level increases grip.
Speed maxspeed — each level increases top speed.

Setup

  1. Add RCC_Customizer_UpgradeManager as a child.
  2. Configure the Level Multipliers array for each category (e.g., engine level 1 = ×1.1, level 2 = ×1.2, level 5 = ×1.5).

Runtime

customizer.UpgradeManager.UpgradeEngine(level: 3);
customizer.UpgradeManager.UpgradeBrake(level: 2);
customizer.UpgradeManager.UpgradeHandling(level: 4);
customizer.UpgradeManager.UpgradeSpeed(level: 5);

Levels persist via PlayerPrefs.

Customization Manager (Tuning)

The CustomizationManager handles per-wheel tuning — camber, toe-in/out, suspension stiffness, ride height.

Setup

  1. Add RCC_Customizer_CustomizationManager as a child.
  2. The manager references the four RCC_WheelCollider instances on the vehicle.

Runtime

customizer.CustomizationManager.SetCamber(wheelIndex: 0, angle: -2.5f);
customizer.CustomizationManager.SetSuspensionDistance(wheelIndex: 0, distance: 0.25f);

This is the "tuning shop" or "garage" panel in a racing game. Often these settings are exposed as sliders in a tuning UI.

Persistence — PlayerPrefs

By default, every change saves to PlayerPrefs immediately. Keys are namespaced by vehicle name so different vehicles save their own state.

To clear all customization for a vehicle:

customizer.ResetLoadout();

To load a saved loadout (typically called automatically on spawn):

customizer.LoadLoadout();

The loadout data structure is RCC_Customizer_Loadout, a serializable class. You can inspect it or save it elsewhere (e.g., to a server) if PlayerPrefs isn't enough.

The Customization Demo Scene

Open RCC_Blank_Customization.unity to see a working example. The scene has:

Use this as a template for your own garage / customization scene.

Customizing the Customization UI

The UI shown in the demo is RCC_Canvas (AIO)'s customization panel — separately togglable. If you want your own UI:

  1. Build your UI normally (Canvas, buttons, sliders).
  2. Wire each button to call the appropriate customizer.XManager.SetX() method.
  3. Hide / show the customization panel via your game's menu logic.

The customization sub-managers are pure logic — they don't depend on the included UI. You can drive them from any UI you build.

Common Customization Issues

"Paint changes color but the change doesn't persist"

The vehicle prefab needs an RCC_Customizer on the root, and the PaintManager needs to be wired correctly. Also, PlayerPrefs is platform-specific — on iOS it persists, on WebGL it's in browser storage which can be cleared by the user.

"Wheel swap doesn't take effect"

The wheel prefab needs to be in the RCC_ChangableWheels.asset array, and the WheelManager's settings need to match the actual wheel hierarchy on the vehicle.

"Spoilers float in the air"

The spoiler attach point is positioned wrong on the vehicle. Move the empty GameObject to where the spoiler should sit. Each spoiler prefab is parented to this point.

"Upgrade levels don't change vehicle performance"

The UpgradeManager needs the Level Multipliers configured. Without them, every level is ×1.0. Also verify that the vehicle's Override Behavior is on — otherwise the behavior preset can stomp on the upgrade-modified values.

"Multi-vehicle game shares customization between cars"

PlayerPrefs keys are typically namespaced by vehicle name. Make sure each vehicle prefab has a unique name in the Hierarchy / Project — duplicates will share keys.

Building a Garage UI from Scratch

A typical workflow:

  1. Set up a separate "garage" scene with a showroom turntable.
  2. On scene load, instantiate the player's currently-selected vehicle.
  3. Show a UI with tabs: Paint, Wheels, Spoilers, Decals, Neon, Sirens, Upgrades.
  4. Each tab calls the appropriate sub-manager method.
  5. Save the state on exit (or auto-save on each change via PlayerPrefs).
  6. On scene transition to gameplay, the vehicle prefab loads its saved customization automatically on Awake.

For a simple example, look at the demo customization scene's UI hierarchy and adapt it.

Next Steps