Camera System

Table of Contents

Overview

RCCP includes a complete camera system (RCCP_Camera) that provides seven different viewing modes, smooth transitions, collision avoidance, and orbit controls. The camera automatically follows the active player vehicle and can be cycled through modes at runtime.

The camera is instantiated from the prefab referenced in RCCP Settings and managed by the RCCP_SceneManager.

Camera Modes

TPS (Third-Person Shoulder)

The default camera mode. The camera follows behind and above the vehicle, providing a classic driving game view. RCCP supports two TPS variants (TPS1 and TPS2) with different distance and height profiles.

FPS (First-Person)

A cockpit view from the driver's perspective. Uses the RCCP_HoodCamera component placed on the vehicle to define the camera position inside the cabin.

Wheel

A low-angle camera mounted near the wheels, using the RCCP_WheelCamera component. Provides a dramatic view of the tires and road surface.

Fixed

A stationary world-space camera managed by RCCP_FixedCamera. The camera stays at a fixed position and rotates to track the vehicle as it drives past, similar to trackside TV cameras in motorsport.

Cinematic

Scripted camera paths managed by RCCP_CinematicCamera. Provides smooth, sweeping camera movements for replays or presentation sequences. Field of view can be animated via RCCP_FOVForCinematicCamera.

Top

A bird's-eye overhead view looking straight down at the vehicle. Supports orthographic projection for a flat, map-like perspective, or perspective projection for a more natural look.

Truck Trailer

A specialized mode for viewing towed trailers or secondary vehicles. Useful when the player is operating a truck-and-trailer configuration.

Changing Camera Modes

Via Input

Press C (default binding) to cycle through camera modes during gameplay.

Via Script


// Cycle to next camera mode
RCCP.ChangeCamera();

// Access the camera directly
RCCP_Camera camera = RCCP_SceneManager.Instance.activePlayerCamera;
camera.cameraMode = RCCP_Camera.CameraMode.TPS;

Camera Features

Collision Avoidance

The TPS camera uses SphereCast raycasting to detect walls, terrain, and objects between the camera and the vehicle. When an obstacle is detected, the camera moves closer to prevent clipping through geometry.

Orbit Control

In TPS modes, the player can orbit the camera around the vehicle using mouse input or the right analog stick on a gamepad. Orbit can be configured to require holding a button (orbit-only-while-holding mode) or to be always active.

Auto-Switch

The camera can automatically cycle through modes on a configurable timer, useful for idle/attract screens or cinematic sequences.

Axis Locking

Each TPS mode can independently lock the camera's X, Y, or Z rotation axis to the vehicle's rotation. This allows customizing whether the camera tilts with the vehicle on hills, rolls during turns, or stays level.

Editable in Lite

All camera configuration parameters are locked in the Lite inspector. The camera system works fully at runtime with default settings. You can switch modes, orbit, and interact with the camera through input — you just cannot edit the distance, height, FOV, or collision settings through the inspector.

Camera Prefabs

The camera system uses several prefab references stored in RCCP Settings:

PrefabDescription
RCCPMainCameraMain camera with RCCP_Camera component
RCCPHoodCameraFirst-person camera mount
RCCPWheelCameraWheel-level camera mount
RCCPCinematicCameraCinematic path camera
RCCPFixedCameraFixed trackside camera

Next Steps