RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Race PacenoteRace PathRace PathnodeRaceRace SegmentRace Start Position

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 Extensionsgameplayrace

Race Start Position

Object class representing a spawn/recovery position in a race path. Stores position and rotation, and provides methods to calculate vehicle placement transforms and teleport vehicles.

Object class representing a spawn/recovery position in a race path. Stores position and rotation, and provides methods to calculate vehicle placement transforms and teleport vehicles.


Constructor

local StartPosition = require('/lua/ge/extensions/gameplay/race/startPosition')
local sp = StartPosition(race, name)

Public API

MethodSignatureReturnsDescription
init(race, name)nilInitializes with position and rotation
set(pos, rot)nilSets position and rotation
calculateVehiclePosRot(vehId, lowPrecision)newPos, vehRotCalculates vehicle-specific transform using OOBB offsets
moveResetVehicleTo(vehId, lowPrecision, repair)newPos, vehRotTeleports a vehicle to this start position
setToVehicle(vehId)nilSets this start position from a vehicle's current transform
getFrontCorners(width, length)tableReturns front corner positions for detection
setRoutePoint / getRoutePoint(rp)rpDynamic route point reference
setStaticRoutePoint / getStaticRoutePoint(rp)rpStatic route point reference
onSerialize / onDeserializedSerialization support
drawDebug(drawMode, clr)nilDraws position as colored triangles

Internals

FieldTypeDescription
racePathParent path reference
idnumberUnique ID
namestringDisplay name (e.g., "standing", "rolling")
posvec3World position
rotquatWorld rotation
routePointtable/nilAssociated dynamic route point
staticRoutePointtable/nilAssociated static route point

How It Works

  1. calculateVehiclePosRot() uses the vehicle's OOBB (oriented bounding box) to compute a precise spawn transform:
    • Extracts the front-left, front-right, back-left corner positions from the OOBB
    • Computes a local offset from the vehicle's position to the front-left corner
    • Maps this offset into the start position's coordinate frame
    • lowPrecision mode places the vehicle 2m behind and 0.5m above (for first-frame spawn when OOBB isn't ready)
  2. moveResetVehicleTo() calls calculateVehiclePosRot() and either directly sets position/rotation (with repair) or uses spawn.safeTeleport (without repair)
  3. setToVehicle() captures a vehicle's current position/rotation, using terrain height for the center point

Usage Examples

-- Create a start position at a specific location
local sp = StartPosition(path, "Default Start")
sp:set(vec3(100, 200, 50), quatFromDir(vec3(0, 1, 0), vec3(0, 0, 1)))

-- Teleport player vehicle to this start
sp:moveResetVehicleTo(playerId)

-- Capture current vehicle position as a start position
sp:setToVehicle(playerId)

Notes

  • Used for: default starts, reverse starts, rolling starts, and recovery points at pathnodes
  • The path references start positions by ID fields: defaultStartPosition, reverseStartPosition, rollingStartPosition, rollingReverseStartPosition
  • Debug drawing renders a colored arrow-like shape showing position and orientation
  • repair parameter defaults to true; when false, uses safe teleport without resetting vehicle damage

See Also

  • Race Pacenote - Related reference
  • Race Path - Related reference
  • Race Pathnode - Related reference
  • Gameplay Systems Guide - Guide

Race Segment

Object class representing a segment (connection) between two pathnodes in a race path. Supports three containment modes: waypoint, capsules, and navpath.

Rally Audio Manager

Manages a queue of pacenote audio playback and pauses for the rally co-driver system. Handles sequential playback with breath timing between notes and damage interruption.

On this page

ConstructorPublic APIInternalsHow It WorksUsage ExamplesNotesSee Also