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.
- Smooth position and rotation following
- Speed-dependent distance and height (dynamic camera)
- Orbit control with mouse or right stick
- Collision detection prevents clipping through geometry
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.
- Fixed to the vehicle's interior camera mount point
- Head movement simulation during acceleration and turning
- Ideal for simulation-focused gameplay
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:
| Prefab | Description |
|---|---|
RCCPMainCamera | Main camera with RCCP_Camera component |
RCCPHoodCamera | First-person camera mount |
RCCPWheelCamera | Wheel-level camera mount |
RCCPCinematicCamera | Cinematic path camera |
RCCPFixedCamera | Fixed trackside camera |
Next Steps
- 07_InputSystem.md — Input handling and controls
- 05_VehicleSystems.md — Vehicle auxiliary systems