Camera System
RCC ships with a complete camera system designed to follow vehicles. It supports six camera modes that the player can cycle through, plus a few specialized cameras for showrooms and replays. This document explains each mode, how to add a camera to a scene, and how to extend the camera system for your own needs.
What RCC_Camera Does
The RCC_Camera component is the main player-following camera. One per scene. It automatically follows whichever vehicle RCC_SceneManager says is the active player. When the player switches cars (e.g., via a car-selection menu), the camera switches its target automatically — no setup required.
The component lives on a child GameObject under the camera's root, and the parent GameObject has the standard Unity Camera component plus AudioListener. RCC's camera replaces Unity's default Main Camera in any RCC scene.
The Camera Modes
RCC_Camera cycles through these modes in order each time the player presses C (or your custom rebind):
TPS — Third-Person Follow
The default. The camera is positioned behind and above the vehicle, looking forward at it. It smoothly follows the vehicle's position and rotation with configurable damping.
This mode has the most tuning options:
- Distance — how far behind the vehicle.
- Height — how high above.
- Rotation Damping — how quickly the camera follows the vehicle's yaw.
- Tilt with Steering — adds slight camera lean during turns for cinematic effect.
- Tilt with Drift — adds more dramatic lean during big slides.
- Look-Back Angle — the angle the camera flips to when the look-back input is held.
Tune these in the RCC_Camera Inspector under the TPS Settings foldout.
Hood — First-Person from Hood
Camera attaches to a "hood camera anchor" inside the vehicle prefab (RCC_HoodCamera component on a child transform). You see the world from approximately the driver's perspective.
This requires the vehicle to have an RCC_HoodCamera GameObject. Most demo vehicles include one already; if yours doesn't, see "Adding Hood Camera to a Vehicle" below.
Wheel — Close-Up Wheel View
Camera attaches to RCC_WheelCamera if the vehicle has one. Shows a close-up of a specific wheel during driving. Cinematic — not useful for actual gameplay, but great for screenshots and replays.
Like the hood camera, this mode requires an RCC_WheelCamera child on the vehicle.
Fixed — Scene Anchor Points
Camera teleports to whichever RCC_FixedCamera instance is in the scene. Useful for setting up dramatic angles at specific scene locations (e.g., a camera that watches the player drive past a particular landmark).
Setup: place RCC_FixedCamera GameObjects in the scene at the angles you want. The camera will cycle between them.
Cinematic — Automated Dramatic Shots
The RCC_CinematicCamera singleton handles automatic cinematic shots: it orbits the vehicle, switches angles every few seconds, and adjusts FOV for dramatic effect. Designed for replays, victory screens, or AFK demo loops.
Setup: drop the RCC_CinematicCamera prefab into your scene (or use Tools → BoneCracker Games → Realistic Car Controller → Create → Cameras → Cinematic Camera).
Top — Top-Down View
Camera positions itself directly above the vehicle looking down. Useful for spatial-awareness gameplay (e.g., parking levels, RTS-style camera) or for previewing a track.
Adding a Camera to a Scene
The easiest path:
Tools → BoneCracker Games → Realistic Car Controller → Create → Cameras → Add RCC Camera To Scene
This adds a properly-configured RCC Camera GameObject. Delete Unity's default Main Camera afterwards — RCC's camera replaces it.
If you instantiate the camera through code (rare), spawn the RCC_MainCameraProvider-managed prefab from RCC_Settings.Instance.RCCMainCamera:
RCC_Camera cam = Instantiate(RCC_Settings.Instance.RCCMainCamera);
The camera will find the active player vehicle on its first Update and start following.
Cycling Cameras at Runtime
Three ways:
1. Input
Press C in any scene. The default Input System binding cycles modes.
2. Public API
RCC.ChangeCamera();
This is what the C key is wired to via RCC_InputManager.
3. Direct Method
RCC_SceneManager.Instance.activePlayerCamera.ChangeCamera();
The first two are equivalent. Use whichever fits your code style.
Adding a Hood Camera to a Vehicle
If you want the Hood mode to work for a custom vehicle:
- Open the vehicle prefab.
- Create a child empty GameObject called
Hood Camera. - Position it at the driver's eye position (roughly at the windshield, slightly inset).
- Rotate it to face forward (+Z).
- Add an
RCC_HoodCameracomponent.
When the player cycles to Hood mode, the main camera will reparent to this transform.
You can position this transform anywhere — front bumper for a bumper cam, dashboard for a dashboard cam, etc.
Adding a Wheel Camera to a Vehicle
Same pattern as hood camera:
- Create a child empty GameObject called
Wheel Camera. - Position it next to one of the wheels (e.g., front-left wheel) at the desired angle.
- Add an
RCC_WheelCameracomponent.
When cycling to Wheel mode, the main camera will reparent to this transform.
Setting Up Fixed Cameras
Fixed cameras are scene-specific anchor points the camera can teleport to.
- Create an empty GameObject in your scene at the location you want.
- Rotate it to point the camera the right way.
- Add an
RCC_FixedCameracomponent.
You can place multiple fixed cameras — the system cycles through them in order on each Fixed mode activation, or based on proximity to the vehicle, depending on the configuration.
Setting Up Cinematic Camera
The cinematic camera is one per scene (a singleton).
- Use Tools → BoneCracker Games → Realistic Car Controller → Create → Cameras → Cinematic Camera to drop it in.
- The component finds the player vehicle automatically and starts orbiting.
Cinematic settings on the component:
- Switch Interval — how often to change angle (default 5 sec).
- Orbit Speed — how fast the camera circles the vehicle.
- FOV — fixed FOV for the cinematic look (default 50).
Camera Field of View (FOV)
Each mode has its own FOV. Tune in the Inspector:
- TPS: typical 60 (default).
- Hood: 75 (closer feels more immersive).
- Wheel: 35 (telephoto compression).
- Fixed: per-fixed-camera setting.
- Cinematic: 50 (default).
- Top: 60 with orthographic option available.
Camera Damping and Smoothness
The camera's follow behavior is damped to feel cinematic. Key tunables:
- Position Damp — how much the camera lags behind the vehicle's position. Higher = more lag (smoother but less responsive).
- Rotation Damp — how much the camera lags the vehicle's yaw.
- Look At Damp — how quickly the camera's look-at point follows the vehicle.
For action / arcade games, decrease these (faster response, more responsive feel). For simulators / cinematic games, increase these (smoother, more cinematic).
Camera Collision Avoidance
RCC's camera does not automatically avoid scene geometry by default. If the camera ends up inside a wall (a common problem in narrow scenes), you have two options:
- Increase Camera Distance — keep the camera further from the vehicle so it's less likely to hit anything.
- Add Custom Collision Logic — write a script that raycasts from the vehicle to the camera and snaps the camera closer if anything's in the way. This is the standard "TPS camera collision" pattern and you'll find Unity tutorials for it.
The reason RCC doesn't ship this is that the optimal behavior depends heavily on your scene layout. A racing game on an open track needs no avoidance; a city scene needs aggressive avoidance.
Adding Custom Camera Modes
If you want a camera mode that RCC doesn't include (e.g., chase from far behind, or a fixed-angle isometric), the cleanest approach is to not modify RCC_Camera. Instead:
- Create your own MonoBehaviour script that controls Unity's Camera component.
- Disable
RCC_Camerawhen your custom mode is active. - Re-enable it when switching back.
For example:
public class CustomTopDownCamera : MonoBehaviour {
public Camera mainCamera;
public Transform vehicleToFollow;
public float height = 30f;
void LateUpdate() {
Vector3 target = vehicleToFollow.position + Vector3.up * height;
mainCamera.transform.position = Vector3.Lerp(mainCamera.transform.position, target, Time.deltaTime * 5);
mainCamera.transform.LookAt(vehicleToFollow);
}
}
To activate: get the active player vehicle from RCC_SceneManager.Instance.activePlayerVehicle, assign it to your script's vehicleToFollow, and disable the RCC_Camera component.
Listening for Camera Changes
If your game has UI that should react to camera mode changes:
using UnityEngine;
public class CameraIndicator : MonoBehaviour {
void OnEnable() { RCC_Events.OnChangeCamera += HandleChange; }
void OnDisable() { RCC_Events.OnChangeCamera -= HandleChange; }
void HandleChange() {
Debug.Log("Camera changed!");
}
}
See 24 — Events System.
Listening for Look-Back
When the player holds the look-back button:
void OnEnable() { RCC_Events.OnLookBack += HandleLookBack; }
void OnDisable() { RCC_Events.OnLookBack -= HandleLookBack; }
void HandleLookBack(bool isLookingBack) {
// Update mirrors, post-processing, etc.
}
Audio Listener
The main camera GameObject also hosts the scene's AudioListener. This is important for 3D positional audio (engine sound coming from the right side when a car drives past). Don't put a separate AudioListener anywhere else in the scene — only one should exist.
Multiple Cameras (Split Screen)
RCC's camera system is designed for single-player. For split-screen multiplayer, you'd need to:
- Disable
RCC_Camera. - Spawn two Unity
Cameras side by side with different viewport rects. - Write your own follow logic per camera, each targeting a different vehicle.
This is non-trivial and outside RCC's core scope. If split-screen is critical to your game, plan for the camera work as a separate task.
Common Camera Issues
"The camera doesn't follow anything"
The Scene Manager hasn't registered a player vehicle. Either tag a vehicle "Player" or call RCC.RegisterPlayerVehicle(vehicle).
"The camera follows but at a weird angle"
Check the Distance, Height, and Rotation Damping values on the TPS settings. Default values are tuned for sports cars — trucks may want higher height and distance.
"Hood mode shows the inside of the body"
The hood camera transform is positioned inside the vehicle mesh. Move it forward / up until it's just outside the cabin geometry.
"The camera is shaky at high speed"
Increase position and rotation damping. Or check that Time.fixedDeltaTime is reasonable (default 0.02 s = 50 Hz). Higher fixed delta times produce visible vehicle vibration at high speed.
"Cinematic mode keeps clipping into the ground"
RCC_CinematicCamera orbits at a fixed height — if your scene has hilly terrain, the camera may dip below ground at certain angles. Increase the cinematic camera's minimum height, or add a raycast clamp to keep it above the ground.
Next Steps
- 14 — Lights System — light setup including dashboard lighting that reacts to the camera mode.
- 24 — Events System — events for camera and look-back changes.
- 23 — Scripting API —
RCC.ChangeCamera()and friends.