On this page
Module guide

Rock Crawl

Drive a four-wheel-drive RCCP vehicle through rock steps, a side slope and staggered cross-axle rocks. Finish with as few penalties as possible.

The example vehicle includes a seated driver. RCCP 2 core supplies the driver model and controller.

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-RockCrawl.unitypackage, made with Export Module > Rock Crawl.

Installation order for Rock Crawl
  1. If any required packages are missing, install Input System, Editor Coroutines and Unity UI in Package Manager.
  2. Install Realistic Car Controller Pro 2 v4.1.3 or later. The RCCP 2 installer stops if a required package is missing.
  3. Open Edit > Project Settings > Player > Other Settings.
  4. Set Active Input Handling to Input System Package (New) or Both.
  5. If Unity requests a restart, restart the Editor.
  6. If TMP Essential Resources are missing, select Window > TextMeshPro > Import TMP Essential Resources.
  7. Use Assets > Import Package > Custom Package to import RCCP2-RockCrawl.unitypackage.

Drive the example

Rock Crawl at the start of Play Mode
No. Item
1 RCCP dashboard: speed, gear and engine RPM
2 Next gate and progress
3 Goal. During the run, this line shows the score and penalties.
4 RETRY button
5 INFO button
6 First gate
  1. Open Assets/RCCP 2 Driving Sandbox/Modules/RockCrawl/Samples/Rock Crawl Example.unity.
  2. Enter Play Mode. The vehicle is the Compact SUV (Samples/Compact SUV/Compact SUV.prefab).
  3. Read the goal in the HUD at the top left. Select INFO to see the controls, the rules and the setup steps.
  4. Drive between the rock walls. Use short throttle inputs and aim for 8–12 km/h.
  5. Cross 01 ROCK STEPS, 02 SIDE SLOPE and 03 CROSS AXLE in order.
  6. After the last gate, the HUD shows FINISHED and the final score.
  7. If you want to park inside, drive on to the service bay. The shutter opens when you are near it.
  8. Select RETRY to return to the starting pose and clear progress.
The three obstacles and the service bay
The Info panel

Keep the wheels near the center line on the staggered rocks. If the vehicle drifts on the slope, steer gently toward the high side. If the vehicle becomes stuck, select RETRY.

The shutter is an optional part of the example. It opens only after the last gate. An amber beacon lights and the motor plays a sound when the shutter opens or closes.

Task result feedback

Rock Crawl result banner

The HUD shows a green banner after you cross the last gate. The HUD keeps the finish status, score and penalties until you select RETRY.

The banner stays fully visible for 3 seconds between fades. A new attempt hides the banner sooner. Play continues during the banner. 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
Start again RETRY button
Show the rules and setup steps INFO button
Rock Crawl keys

Use it in your scene

If you use the complete Driving Sandbox, open your scene. Select your RCCP vehicle in the Hierarchy. On the Rock Crawl card, select Add to Scene.

Move each gate to the end of an obstacle. Point each blue Z axis in the driving direction. Change the INFO text or delete the INFO button. Complete any other steps in the setup dialog.

Relative asset paths start at Assets/RCCP 2 Driving Sandbox/Modules/RockCrawl/.

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 Samples/Compact SUV/Compact SUV.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.

  1. Place the RCCP vehicle at the course start.
  2. If the scene has no RCCP Scene Manager, select Tools > BoneCracker Games > Realistic Car Controller Pro 2 > Add to Scene > Scene Manager.
  3. On RCCP Scene Manager, drag your vehicle from the Hierarchy 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.
  4. Drag Prefabs/Rock Crawl Challenge.prefab into the scene.
  5. Select the challenge. Drag your vehicle from the Hierarchy to Vehicle.
  6. Move the three child gates to your course. The prefab places them for the Quarry Trail.
  7. Put each gate after an obstacle. Point its blue (Z) axis in the direction of travel.
  8. Set Width and Height on each gate to cover the crossing area.
  9. To add a gate, duplicate a child gate. To remove a gate, delete it.
  10. Make sure that Gates lists each gate once, in driving order.
  11. Move the Retry Spawn child to a clear start pose before the first gate. Place the vehicle at the same pose.
  12. Optional: connect On Finished to your results screen.
  13. To show the score, drag Prefabs/Rock Crawl HUD.prefab into the scene. The prefab has its own Canvas.
  14. Drag the challenge from the Hierarchy to Challenge on the HUD. The HUD connects its RETRY button.
  15. If the scene has no EventSystem, select GameObject > UI > Event System. Use an Input System UI Input Module on the EventSystem.
Rock Crawl: 1 Vehicle, 2 Gates, 3 Retry Spawn. Rock Crawl HUD: 1 Challenge
Rock Crawl Gate: 1 Width, 2 Height. RCCP Scene Manager: 1 Active Player Vehicle
The outline of the first gate in the Scene view
The gates on the Quarry Trail
The example hierarchy

The vehicle position must cross each gate plane inside its Width and Height. The challenge measures the vehicle Rigidbody position.

If Retry Spawn is empty, RETRY returns the vehicle to the pose where the current attempt started.

These parts are sample-only:

  • Prefabs/Quarry Trail.prefab is the sample terrain.
  • Samples/Compact SUV/Compact SUV.prefab is the sample vehicle. It uses front and rear RCCP differentials.
  • The INFO panel text in the HUD describes the example. Change the text or delete the INFO button in your scene.
  • Samples/Quarry Environment/QuarryServiceShutter.cs opens the service shutter in the example. It is sample scenery, not part of the challenge. To reuse it, assign Challenge, Shutter Model and Opening Clip. Use a clip that animates the model from closed to open.

Score and thresholds

Each attempt starts at 100 points. The score has a minimum of 0.

Rule Deduction Detection
Chassis contact 8 By default, a new chassis collision counts when the impulse is at least 12 N·s. Repeated contacts with the same surface collider within 0.20 s of a penalty add no penalty.
Reverse episode 5 The vehicle selects reverse and moves rearward at 0.55 m/s or faster for 0.25 s. A new episode can start after 0.35 s out of reverse or at 0.15 m/s rearward or slower.
Rollover 30 The chassis up axis tilts at least 85° from world up. Another rollover can count after the tilt returns to 55° or less.
Points deducted for each event

Use Minimum Contact Impulse to set the impact threshold. Wheel grounding and sustained contact do not add penalties. The last gate locks the score and invokes On Finished once for the attempt.

Script reference

Add using BoneCrackerGames; and using BoneCrackerGames.DrivingSandbox.RockCrawl; to your script.

Member Purpose
RockCrawlChallenge.Vehicle Gets or assigns the scored vehicle. Assigning a vehicle starts a new attempt at its current pose. Use it for a vehicle that you spawn at runtime.
RockCrawlChallenge.ResetAttempt() Clears the score and progress. The attempt starts at the current vehicle pose.
RockCrawlChallenge.Retry() Moves the vehicle to Retry Spawn, or to the start pose of the attempt, and starts a new attempt. It does nothing during a replay or while IsReady is false.
RockCrawlChallenge.IsReady True when the vehicle and the gate list are valid.
RockCrawlChallenge.GatesPassed, GateCount, NextGate Course progress. NextGate is null when the course is finished.
RockCrawlChallenge.ChassisContacts, ReverseEpisodes, Rollovers Penalty counts in the current attempt.
RockCrawlChallenge.Score, Finished Current score, and true after the last gate.
RockCrawlChallenge.OnFinished Invoked once for each attempt after the last gate.
RockCrawlGate.Width, Height Size of the crossing area in local meters.
RockCrawlGate.TryGetCrossing(previousPosition, position, out fraction) True when the segment crosses the gate forward inside its area. Returns the crossing point as a fraction of the segment.
RockCrawlHUD.Retry() Calls Retry() on the assigned challenge.

Troubleshooting

Symptom Cause Fix
The HUD shows ASSIGN THE CHALLENGE ON THIS HUD. Challenge on the HUD is empty. Drag the Rock Crawl Challenge from the Hierarchy to Challenge.
The HUD shows SET UP THE CHALLENGE - SEE THE CONSOLE. Vehicle is empty, is a prefab asset or has no Rigidbody. Or Gates is empty, or a gate is missing or listed twice. Read the Console warning. It names the problem to fix.
A gate does not count. The gate's blue (Z) axis points against the direction of travel, or the vehicle passes outside Width and Height. Turn the gate. Increase Width or Height. Select the gate to see its outline in the Scene view.
The vehicle does not respond to the keys. Active Input Handling uses the old Input Manager, another vehicle is active, or Register Last Vehicle As Player is on. Set Active Input Handling to Input System Package (New) or Both. Assign your vehicle to Active Player Vehicle. Clear Register Last Vehicle As Player.
The buttons do nothing. The EventSystem or its Input System UI Input Module is missing. Add the missing object or component.
The RCCP dashboard has no text. TMP Essential Resources are missing. Select Window > TextMeshPro > Import TMP Essential Resources.