RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Freeroam Big Map MarkersFreeroam Big Map ModeFreeroam Big Map POI ProviderFreeroam Crash Cam ModeFreeroam Crash Cam Mode LoaderFreeroam Drag RaceFreeroam FacilitiesFreeroamFreeroam ConfiguratorFreeroam Gas StationsFreeroam Level StatsFreeroam OrganizationsFreeroam Special TriggersFreeroam Vue Big Map

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsfreeroam

Freeroam Crash Cam Mode

Detects imminent vehicle crashes and triggers cinematic slow-motion camera modes. Supports vehicle-vehicle collisions, static wall impacts, and velocity-based crash detection.

Detects imminent vehicle crashes and triggers cinematic slow-motion camera modes. Supports vehicle-vehicle collisions, static wall impacts, and velocity-based crash detection.


Internal State

FieldTypeDescription
M.onSettingsChangedvariesAssigned as onSettingsChanged

Public API

FunctionSignatureReturnsDescription
M.setTrackingMode(mode)nilSets tracking mode (1=traffic+static, 2=all vehicles+static)
M.getTrackingMode()numberReturns current tracking mode
M.setForcedEnabled(enabled)nilForce-enables crash cam outside freeroam
M.trackCamMode()nilCancels crash cam on manual camera change
M.trackVehReset()nilCancels crash cam on vehicle reset
M.onUpdate(dtReal, dtSim)Per-frame crash detection and camera management
M.onReplayStateChanged(state)-
M.onSerialize()-
M.onClientStartMission()-
M.onClientEndMission(levelPath)-
M.onExtensionUnloaded()-

Camera Modes

ModeProbabilityDescription
145%Close overhead static camera focused on crash point
245%Ground-level camera that rotates to track crash
310%Time-freeze orbit around crash point (5s cooldown)

Detection Methods

OBB-based Vehicle Collision

  • Projects player + traffic vehicle bounding boxes forward by lookAheadTime (0.2s)
  • Checks OBB-OBB overlap with bbSizeFactor (0.85) shrink
  • Requires velocity difference ≥ crashSpeedCutoff (13 m/s)

Static Wall Raycast

  • Casts rays from bottom-edge points in the velocity direction
  • Checks incline angle > 45° and edge angle for head-on detection
  • Verifies velocity component toward wall exceeds speed cutoff

Velocity-Based Fallback

  • Samples player velocity every 0.1s
  • Triggers if velocity change exceeds crashSpeedCutoff + 3 m/s

How It Works

  1. Detection (onUpdate): If cooldown passed and no active crash cam, checks collisions in order: traffic vehicles → walls → velocity delta
  2. Activation (toggleActionCam(true)): Saves sim speed/camera/UI state, sets sim to 0.15x, switches to crash camera
  3. Active Phase: Tracks crash intersection, monitors vehicle visibility in frustum, mode 3 builds orbit camera path
  4. Deactivation: Restores sim speed, UI visibility, previous camera mode after crashCamDuration (4s) or if vehicle leaves frame

Lifecycle Hooks

HookPurpose
onVehicleResettedCancels crash cam for player vehicle
onVehicleSwitchedCancels and restores previous camera
onAnyMissionChangedDisables during missions, re-enables after
onBeforeBigMapActivatedCancels crash cam
onTogglePauseCancels crash cam
onExtensionLoadedReturns false if setting disabled

Notes

  • Only active in freeroam game state unless forcedEnabled
  • Requires enableCrashCam setting to be true
  • Mode 3 (orbit) uses core_paths.playPath() with pause-smooth for dramatic freeze
  • Teleport detection prevents false triggers during vehicle repositioning
  • Loaded conditionally by freeroam_crashCamModeLoader

Additional Exports

  • M.onAnyMissionChanged - (undocumented)
  • M.onBeforeBigMapActivated - (undocumented)
  • M.onExtensionLoaded - (undocumented)
  • M.onTogglePause - (undocumented)
  • M.onVehicleResetted - (undocumented)
  • M.onVehicleSwitched - (undocumented)

See Also

  • Freeroam Big Map Markers - Related reference
  • Freeroam Big Map Mode - Related reference
  • Freeroam Big Map POI Provider - Related reference
  • Freeroam Guide - Guide

Freeroam Big Map POI Provider

M.dependencies = {'gameplay_missions_missions','freeroam_bigMapMode', 'gameplay_rawPois', 'gameplay_playmodeMarkers'}

Freeroam Crash Cam Mode Loader

Conditionally loads/unloads the crash cam extension based on the `enableCrashCam` user setting. Acts as a lightweight settings-reactive loader.

On this page

Internal StatePublic APICamera ModesDetection MethodsOBB-based Vehicle CollisionStatic Wall RaycastVelocity-Based FallbackHow It WorksLifecycle HooksNotesAdditional ExportsSee Also