Destruction Derby
Drive against five RCCP AI rivals in Foundry Arena. The rivals chase the player and each other.
Install the module
If you imported the complete Driving Sandbox, this module is already installed. Go to the next section. Use these steps only for RCCP2-DestructionDerby.unitypackage, made with Export Module > Destruction Derby.
- If any required packages are missing, install Input System, Editor Coroutines and Unity UI in Package Manager.
- Install Realistic Car Controller Pro 2 v4.1.3 or later. The RCCP 2 installer stops if a required package is missing.
- Open Edit > Project Settings > Player > Other Settings.
- Set Active Input Handling to Input System Package (New) or Both.
- If Unity requests a restart, restart the Editor.
- If TMP Essential Resources are missing, select Window > TextMeshPro > Import TMP Essential Resources.
- Use Assets > Import Package > Custom Package to import
RCCP2-DestructionDerby.unitypackage.
Drive the example
| No. | Item |
|---|---|
| 1 | RCCP dashboard: speed, gear and engine RPM |
| 2 | Round status |
| 3 | Time, integrity, score and rivals |
| 4 | RETRY button |
| 5 | INFO button |
| 6 | Player vehicle |
- Open
Assets/RCCP 2 Driving Sandbox/Modules/DestructionDerby/Samples/Foundry Arena.unity. - Enter Play Mode.
- Wait for the countdown.
- Hit the rivals to reduce their integrity and earn points.
- Survive and eliminate all rivals, or lead the survivors on points when the time ends.
- At the end, read the result and your place in the HUD.
- Select RETRY to restart the countdown from the starting grid.
In Foundry Arena, ABS, ESP and TCS are off on all six vehicles. The five rivals face the arena center on the starting grid.
RETRY restores vehicle integrity, clears points and repairs RCCP damage.
Select INFO in the sample to see the controls, rules and setup steps. The round pauses while the Info panel is open.
Task result feedback
The HUD shows a green banner for a win, a red banner for a loss, and an amber banner for a draw. The HUD keeps the result and your place until you select RETRY.
The banner stays fully visible for 3 seconds between fades. A new attempt hides the banner sooner. The banner does not pause the game. The vehicles stop when the round ends. You can use the HUD buttons while the banner is visible.
The supplied HUD has a Result Notification reference. Clear Result Notification to hide the banner and keep the standard HUD. Keep the included Shared/UI/SandboxTaskNotification.cs script in the project when you use the HUD.
Controls
| Action | Key |
|---|---|
| Throttle | W or Up Arrow |
| Brake and reverse | S or Down Arrow |
| Steer | A / D or Left / Right Arrow |
| Handbrake | Space |
| Change camera | C |
Use it in your scene
If you use the complete Driving Sandbox, open your scene. Select your RCCP vehicle in the Hierarchy. On the Destruction Derby card, select Add to Scene.
Assign a flat Box Collider to Arena Floor if the tool did not find one. Add a rival with RCCP AI if necessary. For each new rival, follow steps 5 and 6 below to configure its AI and Agent child. Assign each new rival AI to Rivals. Put solid barriers around the floor. Complete any other steps in the setup dialog.
Relative asset paths start at Assets/RCCP 2 Driving Sandbox/Modules/DestructionDerby/.
In a single module package, or to do it manually, use these steps.
Before you start, prepare a scene with a solid driving surface. To test, drag Assets/Realistic Car Controller Pro 2/Prefabs/Prototype/RCCP_Sedan01.prefab into the scene. Place the vehicle at its normal spawn height above the surface.
To add a driving camera, select Tools > BoneCracker Games > Realistic Car Controller Pro 2 > Add to Scene > RCCP Camera. Then disable the original Main Camera. For the dashboard, select Tools > BoneCracker Games > Realistic Car Controller Pro 2 > Add to Scene > UI Canvas.
If the scene has no RCCP Scene Manager, select Tools > BoneCracker Games > Realistic Car Controller Pro 2 > Add to Scene > Scene Manager.
- Create a flat arena with a Box Collider for the floor. Extend the floor under all starting positions. Use solid outer barriers.
- Place one RCCP player vehicle and at least one rival on the floor.
- Put the player vehicle in the scene before Play. The match reads the player and all starting poses only at startup. It does not accept a player that your code spawns at runtime.
- On RCCP Scene Manager, assign the player to Active Player Vehicle. Clear Register Last Vehicle As Player. If this option is on, the last eligible vehicle can take the player slot at startup.
- On each rival, add AI from the Control group of the RCCP Car Controller Inspector. Set Behaviour to Chase Target.
- If a rival has an Agent child, disable that GameObject in the scene. RCCP AI enables the agent after the match builds the NavMesh.
- Select an empty GameObject. Select Add Component > BoneCracker Games > Driving Sandbox > Destruction Derby > Derby Match. Use only one Derby Match in each scene.
- Assign
Settings/Foundry Derby Settings.assetto Settings. Assign Player and Arena Floor. - Fill Rivals with the RCCP AI components. Drag the GameObject that holds the RCCP AI component, which is a child of the rival vehicle. In the sample, this child is named
Derby AI. Unity rejects the vehicle root. - Optional: use On Round Finished to connect the end of the round to your game.
- For the HUD, add
Prefabs/Derby HUD.prefab. Assign the Derby Match object to Match on the HUD. - If the scene has no EventSystem, select GameObject > UI > Event System. Use an Input System UI Input Module on the EventSystem.
The match builds a NavMesh from the floor at startup. Keep the playable area clear of internal obstacles. The generated NavMesh does not route around internal obstacles.
The INFO button and the Info panel are part of the sample scene only. The HUD prefab does not include them. The match can run without the HUD.
To pause the round while a menu or panel is open, assign that object to Pause While Open on the HUD. While the object is active, the HUD sets Time.timeScale to 0. The HUD restores the previous value when the object closes or the HUD is disabled.
Round rules
A strong vehicle impact reduces integrity. A driver scores only when moving toward the other vehicle faster than 0.5 m/s along the line between the vehicles. Points equal the percentage of integrity lost, rounded to a whole number. A scoring impact adds 40 points if the impact eliminates the other vehicle. Contact with barriers and vehicles outside the match does not affect derby integrity or score.
A vehicle at zero integrity stops driving. Survive and eliminate all rivals to win. If a rival survives the player's elimination, the player loses. At the time limit, the surviving driver with the most points wins. Remaining integrity breaks a points tie.
Surviving drivers rank above eliminated drivers. Drivers eliminated in the same physics step share a place. A tie for first place leaves Winner empty. If the player shares first place or no driver survives, the player result is Draw. If rivals tie for first place and the player ranks below first, the player result is Loss.
The HUD shows the points the player earns from impacts and names eliminated drivers. The result shows the player's place and tells the player to select RETRY. The result also names a sole winner. The HUD shows ROUND DRAW for a draw. If rivals share first place and you finish below first, the HUD shows DERBY LOST.
When the round ends, the match keeps the vehicles stopped until RETRY. To return control to the player, disable Derby Match. If the player was eliminated, also call RCCP.SetEngine(player, true).
RCCP controls physical damage and deformation. The module tracks derby integrity separately. A repair through the RCCP dashboard does not change derby integrity.
Adjust the round
Duplicate Settings/Foundry Derby Settings.asset to adjust another arena.
| Setting | Foundry Arena |
|---|---|
| Countdown Seconds | 3 s |
| Round Seconds | 90 s |
| Minimum Impulse | 1,400 N·s |
| Full Damage Impulse | 10,500 N·s |
| Maximum Damage | 0.65 |
| Same Pair Interval | 0.28 s |
Script reference
Add using BoneCrackerGames; and using BoneCrackerGames.DrivingSandbox.DestructionDerby; to your script.
| Member | Purpose |
|---|---|
ResetRound() |
Restore integrity, clear points, repair RCCP damage, return all vehicles to the scene poses and start the countdown. It does nothing during a replay or on a disabled match. |
State |
Read the round state: Ready, Countdown, Running or Finished. |
Result |
Read the player result: None, Win, Loss or Draw. |
Player, Winner |
Read the player vehicle and the round winner. Winner is empty for a tie or a round with no survivor. |
PlayerPlace, PlayerPlaceTied |
Read the player's final place and whether another driver shares it. |
SecondsRemaining, CountdownRemaining |
Read the round clock and the countdown in seconds. |
PlayerIntegrity, Score, RivalsRemaining |
Read the player integrity from 0 to 1, the player points and the surviving rivals. |
GetIntegrity(vehicle), GetScore(vehicle), GetPlace(vehicle) |
Read the standings of any driver in the match. GetPlace returns 0 before the round ends. |
PointsScored, DriverKnockedOut |
C# events for impact points and eliminations. |
RoundReset, RoundFinished |
C# events for a new countdown and for the end of the round with the player result. |
OnRoundFinished |
Inspector event for the end of the round. Read Result in the listener. |
DerbySettings fields |
countdownSeconds, roundSeconds, minimumImpulse, fullDamageImpulse, maximumDamage and samePairInterval. See Adjust the round. |
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Another vehicle responds to the keys. | Register Last Vehicle As Player is on, or Active Player Vehicle points to another vehicle. | Assign your vehicle to Active Player Vehicle. Clear Register Last Vehicle As Player. |
| The HUD shows ASSIGN THE MATCH ON THIS HUD. | Match on the HUD is empty. | Drag the Derby Match object from the Hierarchy into Match. |
| The HUD shows CHECK ARENA SETUP IN THE CONSOLE. | The match is disabled before the countdown. A setup problem or a second Derby Match causes this status. | Read the Derby Match warning in the Console. Change the field that the warning names. |
| The Console shows Player is not assigned and your code spawns the player. | The match reads the player only at startup. | Put the player vehicle in the scene before Play and assign it to Player. |
| Unity rejects a rival vehicle in Rivals. | Rivals accepts RCCP AI components, not vehicle roots. | Drag the child GameObject that holds the RCCP AI component. |
The Console shows Another Derby Match ('<name>') is already active. |
The scene has two Derby Match components. | Remove or disable the second Derby Match object. |
| RETRY does not respond to clicks. | The EventSystem or its Input System UI Input Module is missing. | Add the missing object or component. |











