Camera Mode: External / Fan Camera
Cinematic external camera that automatically finds interesting viewpoints, pans, zooms, and switches angles. Features two modes: "fan" (handheld/spectator) and "TV" (smooth/broadcast).
Cinematic external camera that automatically finds interesting viewpoints, pans, zooms, and switches angles. Features two modes: "fan" (handheld/spectator) and "TV" (smooth/broadcast).
Class API
| Method | Signature | Description |
|---|---|---|
C:init | () | Initializes all sub-filters, timers, smoothers |
C:onVehicleCameraConfigChanged | () | Updates autopoint ref nodes |
C:onSettingsChanged | () | Reads fan-vs-TV odds setting |
C:setRefNodes | (center, left, back) | Sets vehicle reference nodes |
C:reset | () | Triggers new camera position search |
C:switchCamera | (carVel, carPos, veh, nx, ny, nz, carStopped, openxrSessionRunning) | Finds new camera position with raycasted validation |
C:shouldSwitchCamera | (carPos, carVel, dt) | Determines if camera needs to switch |
C:findNewCamPosVel | (carPos, futureCarPos, velLength, chancesMultiplier, carStopped) | Attempts to place camera halfway to predicted car destination |
C:applyOffset | (nx, ny, nz, offset, openxrSessionRunning) | Applies offset in vehicle-local space |
C:randomizeOffsetSpeeds | (paused, carStopped) | Randomizes offset animation speeds |
C:carTeleported | () | Handles vehicle teleportation detection |
C:camTeleported | () | Handles camera teleportation detection |
C:update | (data) | Main update with position, filters, mode selection |
Sub-Filters Applied
| Filter | Fan Mode | TV Mode | Purpose |
|---|---|---|---|
predictor | ✓ | ✓ | Predicts future target position |
autozoom | ✓ | ✓ | Distance-based FOV adjustment |
autopoint | ✓ | ✓ | Tracks vehicle node offset |
noise | ✓ | ✗ | Subtle camera shake |
smooth | ✓ | ✗ | Position smoothing |
handheld | ✓ | ✓ | Handheld wobble effect |
Camera Switch Triggers
A new camera position is found when any of these conditions are met:
- Just started - camera was just activated
- Too long - exceeded randomized
camChangeTimeMax(base: 4s) - Car invisible - out of sight for > 0.5s
- Going away - car too far AND time exceeded minimum
Position Finding Algorithm
- Predict vehicle's future midway position from velocity
- Account for slopes (raycast ground detection)
- Place camera at random offset from predicted path
- Fan mode: snap to human height above ground (1.3–2.0m)
- Validate line-of-sight at start, midpoint, and end positions
- Retry up to 40 times with progressively relaxed constraints
Fan vs TV Mode
| Aspect | Fan Mode | TV Mode |
|---|---|---|
| Panning | No panning | Camera moves along path |
| Height | Human eye level | Random elevated position |
| FOV range | Wider, step-based | Smoother transitions |
| Odds | 1 - tvModeOdds | tvModeOdds (default 66%) |
Usage Examples
-- Switch to external/fan camera
core_camera.setByName(0, "external")
-- Adjust fan vs TV balance in settings
-- settings.cameraFanVsTV = 0.66 (66% TV mode)Notes
disabledByDefault = true- not in default camera cycleresetCameraOnVehicleReset = false- keeps angle through vehicle resets- Teleportation detection resets camera immediately
- Vehicle node tracking changes every 0.2–5 seconds (randomized)
See Also
- Camera Mode: Autopoint - Related reference
- Camera Mode: Autozoom - Related reference
- Camera Mode: Big Map - Related reference
- Core Systems Guide - Guide
Camera Mode: Driver
First-person driver camera with physics-based head movement, seat adjustment, look-ahead, horizon stabilization, VR support, and per-vehicle saved configurations.
Camera Mode: Fallback
Minimal global filter camera that ensures `pos` and `rot` are always defined. Acts as a safety net in the camera pipeline, running at order 0.6.