RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Activity ManagerAudio Bank ManagerAudio Ribbon SystemBus Route ManagerCamera SystemCore Chat (IRC)Core CheckpointsCore Command HandlerCoupler Camera ModifierDevices (RGB Peripherals)Dynamic PropsEnvironmentFlowgraph ManagerForestFun StuffGame ContextGame StateGround Marker ArrowsGround MarkersHardware InfoHighscoresHotlappingInventoryJob SystemLap TimesLevelsLoad Map CommandMetricsMod ManagerMultiseatMultiseat CameraMulti SpawnOnlinePaths (Camera Paths)Quick Access (Radial Menu)Recovery PromptRemote ControllerReplayRepositoryRope Visual TestScheme Command ServerCore SnapshotCore SoundsCore TerrainTraffic SignalsTrailer RespawnVehicle Active PoolingVehicle Bridge (GE ↔ VLua Communication)Vehicle MirrorsVehicle PaintsCore VehiclesVehicle TriggersVersion UpdateWeather SystemWindows Console
Camera Mode: AutopointCamera Mode: AutozoomCamera Mode: Big MapCamera Mode: ChaseCamera Mode: CollisionCamera Mode: CrashCamera Mode: DriverCamera Mode: External / Fan CameraCamera Mode: FallbackCamera Mode: Free CameraCamera Mode: Game EngineCamera Mode: HandheldCamera Mode: Manual ZoomCamera Mode: NoiseCamera Mode: ObserverCamera Mode: OnboardCamera Mode: OrbitCamera Mode: Pacenote OrbitCamera Mode: PathCamera Mode: PredictorCamera Mode: RelativeCamera Mode: ShakeCamera Mode: SmoothCamera Mode: Top DownCamera Mode: TrackIRCamera Mode: TransitionCamera Mode: Unicycle

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 ExtensionscorecameraModes

Camera Mode: Collision

Filter camera that prevents the camera from clipping through walls and terrain. Uses raycasting from target to camera with near-clip plane corner checks.

Filter camera that prevents the camera from clipping through walls and terrain. Uses raycasting from target to camera with near-clip plane corner checks.


Class API

MethodSignatureDescription
C:init()Resets state, enables raycasting
C:update(data)Moves camera closer if obstruction detected
C:onVehicleSwitched()Re-initializes on vehicle switch
C:collidingCamDistance()Returns colliding distance or nil if not colliding

Properties

PropertyTypeDescription
isFilterbooleantrue - modifies camera position
hiddenbooleantrue - not user-selectable

Collision Detection

  1. Near-clip plane corners: 4 parallel raycasts from target towards camera, offset by near-clip half-width/height
  2. Obstacle-in-front check: Tests if geometry intersects the near-clip plane rectangle
  3. Wall pass-through detection: Raycasts between previous and current near-clip center positions

Two Modes

  • Raycast mode: Active when collisions detected; casts 4 rays from target to camera corners
  • Passive mode: Only checks if obstacles appear in front of camera; re-enables raycast mode when found

Smoothing

  • Camera pulls in instantly when hitting an obstacle
  • Camera returns to normal distance gradually using TemporalSmoothingNonLinear(1, 7)

Constants

ConstantValueDescription
safetyDistance0.1mExtra pullback from hit point
nearClipHalfWidth0.2mAssumed near-clip plane half-width
nearClipHalfHeight0.1mAssumed near-clip plane half-height

Usage Examples

-- Used internally by orbit/chase cameras
local collision = require('core/cameraModes/collision')()
collision:init()
-- Called each frame after main camera position is computed:
collision:update(data) -- modifies data.res.pos if collision detected

Notes

  • Respects settings.cameraCollision toggle - does nothing when disabled
  • Minimum collision distance is clamped to 0.5m to prevent camera inside vehicle

See Also

  • Camera Mode: Autopoint - Related reference
  • Camera Mode: Autozoom - Related reference
  • Camera Mode: Big Map - Related reference
  • Core Systems Guide - Guide

Camera Mode: Chase

Third-person chase camera that follows vehicle direction with automatic forward/backward switching. Features smoothed direction tracking, configurable roll smoothing, and collision detection.

Camera Mode: Crash

Cinematic crash camera with multiple viewpoints. Supports cockpit POV from the second vehicle, overhead close-up, and stationary observer positions.

On this page

Class APIPropertiesCollision DetectionTwo ModesSmoothingConstantsUsage ExamplesNotesSee Also