On this page
Integrations

Enter and exit vehicles

Goal: walk to a vehicle, enter the vehicle, drive, then exit.

Before you start

Complete Your First Drive. This feature uses the optional BCG Shared Assets addon, which is included with RCCP 2.

The addon supplies basic first-person and third-person controllers, cameras, touch controls and control transfer between character and vehicle.

The system supports one local player. Door animations, passenger seats, multiplayer ownership and automatic exit clearance are not included.

1. Import and try the example

  1. Open Tools > BoneCracker Games > Realistic Car Controller Pro 2 > Welcome Window.
  2. Select Addons > BCG Shared Assets > Import.
  3. Wait until Unity finishes the import and compiles the scripts.
  4. On the Demos tab, find Enter / Exit Scenes and open Blank FPS.
  5. If Unity asks, save your previous scene. Then click Play.
  6. Use W/A/S/D to walk and the mouse to look. Stand near the vehicle and look at it.
  7. When the interaction prompt shows, press Tab.
  8. Drive the vehicle, then stop it. Wait for a short time, then press Tab again.

Check: when you enter, the camera changes. The vehicle responds to driving input. When you exit, the character shows again next to the vehicle.

Blank TPS shows third-person control. Both examples use the RCCP 2 Sedan prototype. The examples work without the Demo Content addon.

The old City FPS and City TPS examples are not included.

2. Add the scene manager

Stop Play Mode before you change your scene. Use a vehicle that already drives, an RCCP camera and a scene manager.

See Scenes and Spawning.

Select Tools > BoneCracker Games > Shared Assets > Enter-Exit > Add Main Enter-Exit Manager To Scene.

Check: the Hierarchy has one _BCGEnterExitManager. One manager controls all enterable vehicles in the scene.

3. Make the vehicle enterable

  1. In the Hierarchy, select the root of the vehicle. The root is the object with RCCP_CarController.
  2. Select Tools > BoneCracker Games > Shared Assets > Enter-Exit > Add Enter-Exit To Vehicle.
  3. Expand the vehicle in the Hierarchy and select its new Get Out Pos child.
  4. Move that child next to a door, outside the bodywork. Set its height to the root height of the standing character.

Get Out Pos sets the position of the character root, not the feet. Keep the character collider above the ground. After the vehicle suspension settles, test the height.

Check: the enter/exit component of the vehicle has a Get Out Position. Keep one RCCP camera in the scene.

When you add the component, the component finds the RCCP camera in the scene. The Inspector does not show a camera field. If the component has no camera, the character cannot enter the vehicle.

Do steps 1 to 4 again for each enterable vehicle. An enterable vehicle has player control disabled until a character enters it.

4. Add a character

In the Project window, open Assets/BoneCracker Games Shared Assets/Prefabs/Character/.

View Drag into the Hierarchy
First person BCG_FPSCharacterController.prefab
Third person BCG_TPSCharacterController.prefab and BCG_TPSCamera.prefab

Put the character on clear ground next to the vehicle.

For third person:

  1. Select the root of the character.
  2. On its enter/exit component, make sure that Is TPS Controller? is enabled.
  3. Assign the Camera component of the orbit camera to TPS Camera.
  4. Examine Ray Height. The forward detection line of the character must hit the vehicle body.

Check: make sure that TPS Camera has a camera. The orbit camera does not fill this field automatically.

The supplied character prefabs already have the player enter/exit component. For your own character, select the character root. Then select Tools > BoneCracker Games > Shared Assets > Enter-Exit > Add Enter-Exit To FPS Player. This menu item also works for a third-person character. Then make the assignments above.

5. Save and test the handoff

  1. Save your scene.
  2. Click Play. Look at a vehicle collider from a distance of 1.5 meters or less.
  3. When the prompt shows, press Tab.
  4. Drive a short distance, then stop.
  5. Wait at least one second before you press Tab again.
  6. Make sure that you exit next to the door and that you can walk again.
  7. Stop Play Mode before you make permanent adjustments.

Check: entry, driving and exit work. At each stage, one camera controls the view.

Enter and exit problems

What you see What to check
No prompt near the vehicle Go nearer and look at a collider on the vehicle. The detection ray has a length of 1.5 meters.
No prompt anywhere Make sure that the scene has the enter/exit manager. Read the errors in the component Inspectors.
The vehicle does not move before entry This is correct. An empty enterable vehicle has player control disabled.
Tab does nothing directly after entry Wait for the transition cooldown. Also look for duplicate managers.
No entry or exit while the vehicle moves Stop the vehicle. Enter Exit Speed Limit blocks entry and exit above that speed.
The camera does not change Make sure that the scene has an RCCP camera.
Entry fails with a third-person character Assign TPS Camera on the enter/exit component of the character.
You exit inside the vehicle or another object Stop Play Mode and move Get Out Pos into clear space.
Mobile controls disappear at startup Enable Mobile Controller in the enter/exit settings.

Optional: change the shared settings

Select Tools > BoneCracker Games > Shared Assets > Enter-Exit > Edit Enter-Exit Settings. These settings apply to the addon in all of your project.

Setting What it controls
Auto Lock Mouse Cursor Locks the cursor when the character walks. Releases the cursor in the vehicle. Has no effect with mobile control.
Start Stop Engine Starts the engine on entry and applies the exit behavior below. To control the engine yourself, disable this setting.
Keep Engines Alive Keeps the engine running after exit. Applies only when Start Stop Engine is enabled.
Enter Exit Speed Limit Highest vehicle speed for entry and exit, in km/h.
Mobile Controller Enables the touch control workflow of the addon.

To start inside a vehicle, select the character and enable Player Starts As In Vehicle. Then assign the vehicle to Vehicle.

Keyboard controls

Action Control
Walk W/A/S/D or arrow keys
Look Mouse
Enter / exit Tab
Lock cursor Right mouse button
Unlock cursor Escape

The character controls use Assets/BoneCracker Games Shared Assets/Resources/BCG_InputActions.inputactions. To change the character keys, edit this asset. Character controls are separate from RCCP vehicle controls.

Phone controls

  1. Enable Mobile Controller in the enter/exit settings.
  2. Drag BCG_FPSTPS MobileController.prefab from Assets/BoneCracker Games Shared Assets/Prefabs/UI/ into the scene.
  3. Configure the vehicle touch controls with Mobile.
  4. On the device, test walk, look, entry and exit.

The character canvas has move and look joysticks and an interaction button. When you enter a vehicle, the canvas changes its controls. If Mobile Controller is off, the character canvas disables itself at startup.

For a separate interaction button, add the BCG UI Interaction Button component to a UI Button.

Installation details

The addon installs into Assets/BoneCracker Games Shared Assets/. For a manual installation, use BCG_SharedAssets.unitypackage in the Addons/Installers/ folder of RCCP.

When you import the addon, the addon adds the BCG_ENTEREXIT scripting symbol. When you delete the addon folder, RCCP removes the symbol. If the integration status of the addon looks wrong, examine Welcome Window > Symbols.

Next step

Back to the guide

BoneCracker Games · Realistic Car Controller Pro 2Back to top ↑
Document details

Generated from: 23_integration_enter_exit.md
Date: 2026-11-07 00:57
Generated by md-to-html