Camera System

Table of Contents

RCCP uses a single camera that switches between modes rather than placing multiple camera GameObjects in your scene. The main RCCP_Camera component parents itself to different positions depending on the active mode. This keeps your hierarchy clean and avoids the overhead of maintaining multiple cameras.

For general project setup, see Installation. For vehicle configuration, see Vehicle Setup.


Camera Setup

Adding the Camera to Your Scene

Use the Unity menu:

Tools > BoneCracker Games > Realistic Car Controller Pro > Create > Scene > Add RCCP Camera

This instantiates the RCCP Camera prefab referenced in RCCP_Settings. The prefab contains:

How Targeting Works

RCCP_Camera uses a CameraTarget class that holds:

FieldTypeDescription
playerVehicleRCCP_CarControllerThe vehicle the camera follows
HoodCameraRCCP_HoodCameraAuto-found on the vehicle via GetComponentInChildren
WheelCameraRCCP_WheelCameraAuto-found on the vehicle via GetComponentInChildren

When a vehicle is registered as the player vehicle through RCCP_SceneManager, the camera's SetTarget() method is called automatically. If TPSAutoFocus is enabled (the default), the camera smoothly adjusts its distance and height to fit the vehicle's bounds.


Camera Modes

The CameraMode enum defines all available modes:

ModeEnum ValueDescription
Third-PersonTPSDefault follow camera behind the vehicle
First-Person / HoodFPSView from inside the vehicle (dashboard area)
WheelWHEELClose-up view near a wheel
FixedFIXEDScene-placed camera that watches the vehicle pass by
CinematicCINEMATICAuto-tracking camera with animation support
Top-DownTOPOverhead view, optionally orthographic
Truck-TrailerTRUCKTRAILERSpecialized TPS mode for vehicles towing trailers

Enabling and Disabling Modes

Each mode (except TPS and TRUCKTRAILER) can be toggled on or off. When a mode is disabled, the camera skips it when cycling:

PropertyDefaultControls
useHoodCameraModetrueFPS mode availability
useWheelCameraModetrueWHEEL mode availability
useFixedCameraModetrueFIXED mode availability
useCinematicCameraModetrueCINEMATIC mode availability
useTopCameraModefalseTOP mode availability
useCrashCameraModetrueWhether the crash cinematic may take this camera over -- not part of the cycle

TPS mode is always available and is the fallback when other modes encounter issues (such as occlusion in Wheel mode).

useCrashCameraMode sits with these in the inspector but is the odd one out: CRASH is never reached by cycling, so the toggle controls whether a heavy impact is allowed to take the camera over. See Crash Cinematic.


Third-Person Mode (TPS)

The TPS camera follows behind the vehicle at a configurable distance and height. RCCP provides two TPS sub-modes:

Sub-ModeEnumCharacteristics
TPS1TPSMode.TPS1Original implementation using SmoothDampAngle per axis
TPS2TPSMode.TPS2More stable approach using Quaternion.Slerp, includes drift support

Select the sub-mode via the tPSMode property. TPS2 is the default and recommended choice.

Transform Settings

PropertyRangeDefaultDescription
TPSDistance0 - 206.5Distance behind the vehicle
TPSHeight0 - 101.5Height above the vehicle
TPSOffsetVector3(0, 0, 0.2)Local offset relative to the vehicle
TPSRotationDamping0 - 10.5Smoothing factor for rotation tracking
TPSPitch-45 to 457.5Downward pitch angle
TPSYaw-45 to 450Lateral yaw offset

Rotation Locking

These control which vehicle rotation axes the camera follows:

PropertyDefaultEffect
TPSLockXtrueCamera tracks vehicle pitch
TPSLockYtrueCamera tracks vehicle yaw
TPSLockZfalseCamera tracks vehicle roll

Dynamic Camera

When TPSDynamic is enabled, the camera distance, height, and pitch angle shift based on the vehicle's acceleration. This creates a more cinematic feel during rapid speed changes. The system uses a hidden TPSAccelerationPoint transform to smooth the acceleration offset.

Speed-Based FOV

The field of view interpolates between TPSMinimumFOV and TPSMaximumFOV based on vehicle speed, creating a sense of velocity.

PropertyRangeDefaultDescription
TPSMinimumFOV10 - 9040FOV when stationary
TPSMaximumFOV10 - 16060FOV at high speed

Auto Focus

When TPSAutoFocus is true (the default), SetTarget() triggers a coroutine that calculates the vehicle's bounding-box extent and smoothly adjusts TPSDistance and TPSHeight over 2 seconds. This ensures each vehicle is framed correctly regardless of its size.

Auto Reverse

When TPSAutoReverse is true (the default), the camera automatically rotates 180 degrees to look forward when the vehicle reverses.

Camera Tilt

The camera tilts along the Z axis based on lateral velocity, creating a leaning effect during turns:

PropertyRangeDefaultDescription
TPSTiltMaximum0 - 2515Maximum tilt angle in degrees
TPSTiltMultiplier0 - 1.51Multiplier to fine-tune tilt intensity

Camera Shake

When TPSShake is true (the default), the camera applies subtle Perlin noise-based positional and rotational shake that increases with vehicle speed. Maximum shake occurs around 260 km/h.

Since V2.51 you can also trigger a one-shot impact jolt from code: RCCP_Camera.TriggerCollisionShake(float intensity) pushes the camera pivot briefly backward and upward with a randomized rotation kick. RCCP uses it internally for exhaust backfire and NOS jolts; call it from your own scripts for any custom VFX impulse (explosions, landings, scripted hits).


RCCP_SceneManager.Instance.activePlayerCamera.TriggerCollisionShake(1.5f);

Free Fall Behavior

When TPSFreeFall is true (the default), the camera rotation damping drops to near zero while the vehicle is airborne. This means the camera holds its orientation in the air rather than tracking the vehicle's tumbling.


Hood Camera (FPS Mode)

The hood camera provides a first-person view from inside the vehicle, typically at dashboard level.

Setup

  1. Create an empty GameObject as a child of your vehicle.
  2. Position it where the driver's eyes would be (on or near the dashboard).
  3. Add the RCCP_HoodCamera component to it.
  4. (Optional) Add a ConfigurableJoint and Rigidbody to reduce camera shake. The component auto-connects the joint to the vehicle's Rigidbody on start.

The RCCP_Camera finds the RCCP_HoodCamera on the target vehicle automatically via GetComponentInChildren.

FOV

The hood camera uses hoodCameraFOV on the RCCP_Camera component (default 60, range 10-160 degrees).

Orbit in Hood Mode

When useOrbitInHoodCameraMode is true (the default), the player can look around using mouse or touch input while in FPS mode.


Wheel Camera

The wheel camera provides a low-angle close-up of a vehicle wheel.

Setup

  1. Create an empty GameObject as a child of your vehicle, near one of the wheels.
  2. Orient it to point at the wheel.
  3. Add the RCCP_WheelCamera component.

The RCCP_Camera finds it automatically. If occlusion is detected (an obstacle between the camera and the vehicle), the camera automatically reverts to TPS mode.

FOV

The wheel camera uses wheelCameraFOV on the RCCP_Camera component (default 60, range 10-160 degrees).


Fixed Camera

The RCCP_FixedCamera is a singleton placed in the scene. When active, the RCCP Camera parents itself to the fixed camera's position. The fixed camera:

Setup

  1. Add an RCCP_FixedCamera component to a GameObject in your scene.
  2. Set maxDistance to control how far the vehicle can travel before the camera relocates.
  3. Configure minimumFOV (default 20) and maximumFOV (default 60) for zoom behavior.

Only one RCCP_FixedCamera should exist in a scene (it is a singleton).


Cinematic Camera

The RCCP_CinematicCamera is a singleton that smoothly tracks the vehicle from a trailing position. It includes a Pivot child GameObject that can hold Unity animations for camera movement.

Setup

  1. Add an RCCP_CinematicCamera component to a GameObject in your scene.
  2. Optionally, add animations to its Pivot child for sweeping camera motions.
  3. Use RCCP_FOVForCinematicCamera on the Pivot to feed animated FOV values back to the cinematic camera.

The cinematic camera rotates smoothly toward the vehicle's heading and maintains a following distance of about 10 meters.


Top-Down Camera

The top-down camera provides an overhead view, useful for racing games with a top-down perspective.

PropertyDefaultDescription
topCameraAngle(45, 45, 0)Euler angle of the overhead view
topCameraDistance100Distance from the vehicle
maximumZDistanceOffset10Forward offset based on speed
useOrthoForTopCamerafalseIf true, switches to orthographic projection
minimumOrtSize10Orthographic size when stationary
maximumOrtSize20Orthographic size at speed

The camera position lerps smoothly toward the vehicle and adjusts the forward offset based on vehicle speed.


Truck-Trailer Camera

When a vehicle has a connected trailer (RCCP_TrailerController), the TPS mode automatically switches to TRUCKTRAILER. This mode:

When the trailer is disconnected, the camera automatically reverts to standard TPS mode.


Orbit Controls

Orbit allows the player to rotate the camera around the vehicle using mouse or touch input in TPS and Hood modes.

Settings

PropertyDefaultDescription
useOrbitInTPSCameraModetrueEnable orbit in TPS
useOrbitInHoodCameraModetrueEnable orbit in Hood/FPS
useOrbitOnlyHoldingtrueOrbit only while mouse button is held
orbitXSpeed100Horizontal orbit speed
orbitYSpeed100Vertical orbit speed
orbitSmooth25Smoothing factor
minOrbitY-15Minimum vertical angle
maxOrbitY70Maximum vertical angle
orbitResettrueAuto-reset orbit when vehicle is moving

Mobile Orbit

For mobile touch input, call RCCP_Camera.OnDrag(PointerEventData) from a UI drag panel. This feeds touch delta into the orbit system.

Look-Back

The lookBackNow property rotates the camera 180 degrees to face behind the vehicle. This is triggered by the look-back input binding (see Inputs).


Zoom

In TPS mode, mouse scroll input adjusts the camera distance:

PropertyRangeDefaultDescription
zoomScrollMultiplier0.5 - 105Sensitivity of scroll zoom
minimumScroll0+0Minimum zoom offset
maximumScroll0+5Maximum zoom offset

Occlusion / Collision Detection

When useOcclusion is true (the default), the camera performs a SphereCast from the vehicle toward the desired camera position. If the ray hits a collider (excluding vehicle layers and triggers), the camera repositions to the hit point plus a small normal offset. This prevents the camera from clipping through walls and terrain.

The occlusionLayerMask controls which layers are checked. By default, it includes all layers except RCCP vehicle layers.


Auto-Change Camera

When useAutoChangeCamera is enabled, the camera automatically cycles to the next available mode on a fixed interval. Since V2.51 the interval is configurable via autoChangeCameraInterval (default 10 seconds, minimum 0.1 — the default matches the previously hardcoded value). The autoChangeCameraTimer property tracks the current countdown. This is useful for demo scenes and attract modes.


Switching Camera at Runtime

Cycle to Next Mode


// Using the static API
RCCP.ChangeCamera();

// Or directly on the camera component
RCCP_SceneManager.Instance.activePlayerCamera.ChangeCamera();

Switch to a Specific Mode


RCCP_Camera cam = RCCP_SceneManager.Instance.activePlayerCamera;
cam.ChangeCamera(RCCP_Camera.CameraMode.TOP);

Toggle Camera On/Off


RCCP_Camera cam = RCCP_SceneManager.Instance.activePlayerCamera;
cam.ToggleCamera(false); // Disables rendering
cam.ToggleCamera(true);  // Re-enables rendering

Showroom Cameras

RCCP includes two additional camera components for menus and vehicle selection screens.

RCCP_ShowroomCamera

An orbiting camera for main menus and vehicle showcases.

PropertyDefaultDescription
target(none)Transform to orbit around
distance8Distance from target
orbitingNowtrueEnable auto-rotation
orbitSpeed5Auto-rotation speed
smoothtrueSmooth position/rotation interpolation
smoothingFactor5Interpolation speed
minY / maxY5 / 35Vertical angle limits
dragSpeed10Manual drag rotation speed

Call OnDrag(PointerEventData) from a UI element to enable player-controlled rotation. Use ToggleAutoRotation(bool) to start or stop automatic orbiting.

RCCP_CameraCarSelection

A simpler orbiting camera specifically for vehicle selection UIs. It automatically rotates around the target at a fixed angle and distance. No manual drag input by default.

PropertyDefaultDescription
target(none)Transform to orbit around
distance5Distance from target
speed25Rotation speed
angle10Vertical viewing angle

Common Issues

Camera Does Not Follow the Vehicle

Camera Clips Through Walls

Hood or Wheel Camera Is Skipped

Camera Shakes Excessively in Hood Mode

Truck-Trailer Mode Activates Unexpectedly


Photo Mode & Interior Audio Muffle (V2.55+)

Two opt-in camera-side extras. Both default off.


Crash Cinematic (V3.0)

RCCP_CrashCamera drops the world into slow motion on a catastrophic impact and cuts to a camera framed on the point of impact, so you can actually watch the bodywork deform. It exists mainly to make the soft-body deformation solver visible -- the solver's panels flex, overshoot and settle over about half a second, which at normal speed passes in a blur.

It is opt-in and not present by default. Add it via Tools > BoneCracker Games > Realistic Car Controller Pro > Add to Scene > Crash Camera, or from the Crash section of the RCCP_Camera inspector, which offers the same create / select button as the Fixed and Cinematic sections above it. Both routes create the same single director. A project that never adds it behaves exactly as before.

The camera's own Use Crash Camera Mode toggle (useCrashCameraMode, on by default) is the per-camera opt-out. Turn it off and that camera is never taken over, however hard the vehicle is hit and whether or not the system is in the scene. Every entry path respects it, including RCCP.TriggerCrashCam(), which then returns false.

What triggers it

A crash qualifies on Δv -- the speed the car instantly loses in a single impact, computed as collision.impulse.magnitude / rigidbody.mass. The default is 12 m/s, roughly 43 km/h of speed killed.

Δv is used rather than raw impulse because impulse scales with mass: a threshold tuned on a family car would fire constantly on a truck and never on a kart. Δv is mass-independent, so one value works across your whole fleet. It also rejects scrapes automatically -- sliding along a wall at 180 km/h produces a very small per-contact Δv.

What happens

  1. The camera scores 24 candidate positions around the impact point, rejecting any that are behind geometry or below ground, and preferring ones that face the damaged panel while keeping the car in frame.
  2. If no unoccluded angle exists -- inside a tunnel, under a bridge -- nothing happens at all. The cinematic is abandoned rather than framing a wall.
  3. Otherwise, time slows, the camera cuts to the winning angle, and orbits while pushing in.
  4. The shot ends when the deformation settles, after Maximum Duration, or as soon as you touch a driving control.

The car stays drivable the whole time. The cinematic never takes control away from you -- it is a camera and a time scale, nothing more.

Settings

SettingDefaultWhat it does
Auto TriggerOnFire automatically on a qualifying impact. Off = RCCP.TriggerCrashCam() only.
Minimum Speed Loss12 m/sHow hard a crash has to be. Raise it for fewer, bigger moments.
Retrigger Cooldown5 sStops a tumbling wreck firing the sequence repeatedly.
Slow Motion Scale0.25How far time slows. 1 keeps the camera cut without the slow motion.
Minimum / Maximum Duration1 s / 3 sReal-time bounds on the shot.
Recover Duration0.75 sHow long time takes to ease back to normal.
Shot Distance5 mHow far the camera sits from the impact. It pushes in to 75% of this.
Orbit Speed7°/sHow fast the camera circles. 0 gives a locked-off shot.
Crash Field Of View21°Tighter than the chase camera, for a more dramatic frame.
Occlusion MaskEverythingLayers that block the camera's view.
Crash Pitch0.65How far audio pitch drops during the cinematic. 1 leaves audio alone.
Cancel On InputOnEnd the shot when the player makes a new driving input. Controls already held at the moment of impact don't count until released and pressed again.

The default audio pitch is provisional pending final calibration.

Scripting


RCCP.TriggerCrashCam();        // play it now, ignoring the Δv and cooldown gates
RCCP.CancelCrashCam();         // end it early
bool playing = RCCP.IsCrashCamActive;

RCCP_Events.OnRCCPCrashCamStarted += (vehicle, impactPoint) => { /* … */ };
RCCP_Events.OnRCCPCrashCamEnded   += vehicle => { /* … */ };

Important limitations

Multiplayer. The cinematic changes Time.timeScale, which is global and will desync a networked session (Photon, Mirror). For multiplayer builds, turn Auto Trigger off or set Slow Motion Scale to 1.

VR. Slow motion combined with a camera cut is a well-known nausea trigger. Not recommended for VR projects.

Photo Mode takes precedence. The cinematic will not start while photo mode is active, and ends immediately if photo mode is entered.

Related Topics


Support: bonecrackergames@gmail.com | www.bonecrackergames.com

Need help? See Troubleshooting