Lights
Goal: add headlights, brake lights and indicators that work. Then make their lenses glow.
Before you start
Use an RCCP vehicle that drives, and stop Play Mode. A lamp is one single light. The Lights module controls all the lamps on the vehicle.
1. Create the lamps
- Select the vehicle root in the Hierarchy.
- Select Tools > BoneCracker Games > Realistic Car Controller Pro 2 > Vehicle Setup > Light Setup.
- Under Light Types, select the lamps that you need.
- Keep Show Placement Handles In Scene enabled.
- Under Flare Settings, adjust Forward Offset, Side Offset and Height Offset to move the preview discs.
- Click Create Lights.
Check: the lamps appear under the Lights module.
The wizard uses the Lights module that the vehicle already has, also if that module is inactive. If the vehicle has no Lights module, the wizard creates one under the module container of the vehicle.
NOTE: If the vehicle already has lamps, the wizard shows the Vehicle Already Has Lights warning and disables Create Lights.
Use the wizard one time only. To change lamps that exist, edit them, or remove them before you use the wizard again.
The wizard calculates the positions from the bounds of the vehicle. Examine the result from the front, the rear and the side. Do not assume that the positions fit your model.
After you create the lamps, select the Lights module and enable Edit Light Positions in its Inspector. Drag the handle of each lamp to adjust its position.
When you remove a Lights module, the vehicle root stays. If a legacy Lights component is on the root, the lamp objects also stay. To restore the removed module, use Edit > Undo.
2. Set brightness and glowing lenses
- Select one lamp in the Hierarchy.
- Examine its Light function, for example low beam, brake light or left indicator.
- Set Brightness on the RCCP Light component.
- Drag the lens mesh renderer of the model into Lens renderer.
- If that mesh has more than one material, select Lens material slot. The first slot is 0.
- Set Lens color.
Check: when the lamp comes on, its lens glows and the lamp gives light.
A lamp can also be a lens only, with no Unity Light component. Its lens glows, but the lamp gives no light.
Open the screenshot at full size. 1 Select the function of the lamp. 2 Adjust its brightness here. 3 Assign the mesh that glows. Then select its material slot below.
In this example, Lens renderer shows None. Assign your lens mesh to complete the glow setup.
If the model has no applicable lens mesh, click Create LightBox. The button creates a small glowing plate and assigns it. Move the plate and change its size to fit the model. Duplicate To Other Side makes a mirror copy of a completed lamp. The copy also changes a left indicator to a right indicator, and the opposite.
Lamp appearance settings
| Setting | Controls |
|---|---|
| Brightness | How bright the lamp is when it is on |
| Fade speed | How quickly the lamp comes on and fades |
| Lens renderer | The visible mesh that glows |
| Lens material slot | The material on that mesh that glows |
| Lens color | Glow color |
| Extra glowing meshes | More meshes that glow with the lamp |
Edit Brightness on RCCP Light, not Intensity on Unity Light. During operation, RCCP sets the value of the Unity Light. The intensity preview in the Light Setup wizard is also not the final RCCP brightness setting.
3. Test the controls
Click Play and click in the Game view. Then try the standard keyboard bindings:
| Key or action | Expected result |
|---|---|
| L | Low beams come on or go off |
| K | High beams come on or go off |
| Q / E | Left / right indicators flash |
| Z | Hazard lights flash |
| Brake while the vehicle moves | Brake lamps come on |
| Engage reverse | Reverse lamps come on |
Check: each function lights the correct lamps. After you adjust the setup, stop Play Mode and save the scene.
Controls gives the rebinding procedure. For tests during edits, the Lights module also has the switches Low beam on, High beam on and Hazards on.
Lamp functions
Light function sets when a lamp comes on. A tail lamp follows the low beams. A brake lamp follows the brake pedal.
If a vehicle has no tail lamps, its brake lamps also glow a small amount with the low beams. Add tail lamps to keep these two functions separate.
On the Lights module, High beams need low beams lets the high beams come on only when the low beams are on.
Brake lights and reverse lights follow the vehicle state. These lights do not need manual switches.
Optional: lens flares
A lens flare is the bright effect that you see when you look at a lamp.
- Select the lamp.
- Enable Lens flare.
- Click Create LensFlare. The button adds the flare component that matches the render pipeline.
- Test from different angles and distances.
Flare brightness sets the strength of the flare. Flare half-distance sets how quickly the flare fades with distance. For the render-pipeline requirements, refer to Render Pipelines.
Fake headlight beams and the pool of light on the road
Fake beams use visible geometry to show headlight cones and a lit area on the road ahead of the vehicle. Fake beams make headlights more visible in a night scene or a tunnel scene.
Add fake beams
- Open the Lights module of the vehicle.
- If the vehicle does not have fake beams, click Add Fake Headlight Beams.
- Edit the settings in the Fake Headlight Beams section of the Lights Inspector.
- If the component shows a material warning, click Assign Shipped Materials.
- Test the vehicle with the low beams on, in the lighting of your scene.
Check: the beams and the ground pool appear, fade with the headlights and go off when the lamps go off. Also test a player build. Do not trust the fallback materials of the Editor.
Only low-beam and high-beam lamps get cones. Brake, tail and indicator lamps do not get cones.
The effect component is a child of the Lights module. Enabled keeps the settings when you disable the effect. Remove removes the effect. Components that are on the vehicle root continue to work. To move such an effect, open the source prefab in Prefab Mode and click Move Under Lights (Undo Supported).
Fake beam settings
| Setting | What it changes |
|---|---|
| Cone Intensity | Visible beam brightness |
| Pool Intensity | Brightness on the road |
| Cone Length / Cone End Radius | Beam length and width |
| Edge Softness | Softness around the beam |
| Pool Width / Pool Length | Size of the ground pool |
| Ground Mask | Layers that count as road |
| Ground Raycast Interval | How often the pool finds the height and slope of the road |
Change the shape settings outside Play Mode. Adjust the intensity in the lighting where the vehicle operates. In bright daylight, additive beams can be difficult to see.
Ground pool method per render pipeline
Ground Mode > Auto selects a supported method:
| Method | Behavior |
|---|---|
| Flat quad | A flat pool. Works in all render pipelines |
| URP decal projector | Follows the shape of the surface. Needs the Decal Renderer Feature on the active URP renderer and a supported setup that is not deferred |
To see which method runs, read the status banner of the component. For pipeline setup, refer to Render Pipelines.
The pool fades when the road ahead turns away (from approximately 10° to 30°) or meets a wall. The pool also fades while the vehicle is in the air.
Fake beam performance
Fade Start and Cull Distance decrease the cost of distant beams. A scene-wide budget also gives priority to near vehicles. In dense traffic, distant beams can disappear.
Disable Real Headlights is optional. This setting disables the real headlight illumination and keeps the lenses and the fake beams. Test the look first. Fake geometry does not replace all lighting effects of a real light.
Lamp breakage in a crash
On each lamp, Can be smashed, Toughness and Smashes below control breakage.
On the Damage module, enable Break the lamps. Then adjust Lamp damage reach and Lamp damage strength. Hit the vehicle near the lamp. Then repair the vehicle.
Check: a broken lamp stays dark, and the repair restores it. Refer to Damage.
Light troubleshooting
| What you see | What to check |
|---|---|
| Light on the road, but a dark lens | Lens renderer, material slot and a material that supports emission |
| Lamps overlap or appear two times | Look for lamps that you copied two times, for example with Duplicate To Other Side. |
| Brightness resets during Play | Change Brightness on RCCP Light. |
| No high beams | Lamp functions and High beams need low beams |
| Fake beams are missing in a build | A material warning on RCCP Light Cones (click Assign Shipped Materials), lamp brightness and distance/budget limits |
| Too many lights decrease performance | RCCP Settings > Optimization > Lights and Performance and Platforms |
The global Headlights as vertex lights option and the brake-light, reverse-light and indicator options decrease the lighting quality and the cost. Test their effect on your target device.
Read next
- Damage — broken lamps and repair.
- Render Pipelines — materials, flares and decals.
- Field Reference — detailed light settings.
