RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorVehicle ExporterFollow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track GeneratorRectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot CreatorShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files SyntaxVehicle Rope DebugBatch WorkerWebSocket Test
Basic BordersBasic CentersBorder Wall MeshCamera TransitionCeiling MeshTrack MarkersMaterial UtilTrack MeshesMulti Track MergerObstacle PlacerTrack PiecesProcedural PrimitivesQuickrace SetupSegment To Procedural MeshSpline Track

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 ExtensionsutiltrackBuilder

Camera Transition

Smoothly lerps the free camera from its current position/rotation to a target over a specified duration.

Smoothly lerps the free camera from its current position/rotation to a target over a specified duration.


Overview

util_trackBuilder_cameraTransition provides a simple camera interpolation system. Call lerpTo(pos, rot, time) and the camera will smoothly transition using an ease-out curve. Used by the track builder for camera fly-throughs.

Module path: lua/ge/extensions/util/trackBuilder/cameraTransition.lua


Exports (M)

FunctionSignatureDescription
lerpTo(pos, rot, time)Starts a smooth camera transition to the target position and rotation.
onPreRender(dt)Updates the camera each frame during a transition.

Internals

Interpolation

  • Position: Linear interpolation: old * (1 - t) + target * t.
  • Rotation: Quaternion nlerp: oldQuat:nlerp(targetQuat, t).
  • Easing: Ease-out curve: t = 1 - (1 - linear_t)².

State

  • oldPosition / oldQuat - captured from current camera at lerpTo call.
  • targetPosition / targetQuat - the destination.
  • transitionTime - total duration in seconds.
  • remainingTime - counts down each frame.

Requirements

Only applies when in free camera mode (commands.isFreeCamera()). Uses core_camera.setPosRot() to update.

Instant Transition

If time <= 0, the camera is set immediately without interpolation.


How It Works

  1. Call lerpTo(pos, rot, time) to start.
  2. Current camera position/rotation is captured.
  3. Each frame in onPreRender, the remaining time decreases and the camera is interpolated.
  4. After time seconds, the camera reaches the target exactly.

Lua Examples

local camTrans = extensions.util_trackBuilder_cameraTransition

-- Smoothly move camera to a position over 2 seconds
camTrans.lerpTo(
  vec3(100, 200, 50),
  quatFromDir(vec3(0, -1, 0)),
  2.0
)

-- Instant teleport
camTrans.lerpTo(vec3(0, 0, 100), quat(0,0,0,1), 0)

Additional Exports

  • M.lerpTo - (undocumented)
  • M.onPreRender - (undocumented)

See Also

  • Track Builder - Basic Borders - Related reference
  • Track Builder - Basic Centers - Related reference
  • Track Builder - Border Wall Mesh - Related reference
  • Game Engine Overview - Guide

Border Wall Mesh

Generates vertical wall meshes for left and right track borders with configurable height.

Ceiling Mesh

Generates ceiling/tunnel mesh geometry above track segments in the track builder system.

On this page

OverviewExports (M)InternalsInterpolationStateRequirementsInstant TransitionHow It WorksLua ExamplesAdditional ExportsSee Also