RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Bus DriverDamage GoalDemolition DerbyDistance GoalDrift GoalFinish Race GoalNo-Move GoalPosition GoalQuick RaceQuick Race LoaderRace MarkersRace DebugRace Goals ManagerRace UIScenario HelperScenario EngineScenarios LoaderSpeed GoalTime Limit GoalWaypoint ActionScenario Waypoints

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 Extensionsscenario

Race Markers

Central manager for all race checkpoint markers. Creates, pools, positions, and updates marker objects. Supports swappable marker types and delegates rendering to individual marker instances.

Central manager for all race checkpoint markers. Creates, pools, positions, and updates marker objects. Supports swappable marker types and delegates rendering to individual marker instances.


Public API (Exports)

FunctionSignatureDescription
M.init()Clears all marker lists and hides markers
M.setupMarkers(wps, marker)Creates markers for all waypoints; optionally sets marker type
M.render(dt, dtSim)Per-frame update - calls update on all active markers
M.setModes(wpModes)Sets mode (color/visibility) for each waypoint by name
M.setToCheckpoints(data)Repositions markers using waypoint data by name
M.hide()Hides all markers
M.show()Shows all markers
M.createRaceMarker(detached, type)Creates a single marker instance (optionally detached from pool)
M.drawOnMinimap(td)Delegates minimap drawing to markers that support it
M.onClientEndMission()Clears all markers and resets default marker type

Internals

VariableDescription
markersTable of marker lists keyed by name (default: 'markers')
idToMarkerMaps marker ID → marker instance for iteration
defaultMarkerDefault marker module path: "scenario/raceMarkers/sideColumnMarker"
createMarkerCurrent marker factory function (loaded via require)

How It Works

  1. Marker type selection: setupMarkers accepts an optional marker name string (e.g., "ringMarker"). If provided, loads scenario/raceMarkers/<name>. Falls back to sideColumnMarker.
  2. Marker creation: For each waypoint, creates a marker via the factory, calls createMarkers() then setToCheckpoint(wp).
  3. Mode management: setModes(wpModes) takes a table {waypointName = mode}. Markers not listed get 'hidden'.
  4. Rendering: render(dt, dtSim) iterates all idToMarker entries and calls m:update(dt, dtSim).
  5. Detached markers: createRaceMarker(true) creates a marker not tracked in idToMarker - useful for custom one-off markers.
  6. Cleanup: onClientEndMission deletes all markers and resets createMarker to prevent stale module references.

Usage Example

-- Setup markers for a race (called by waypoints system):
local wps = {
  {name = "wp1", pos = vec3(100,200,50), radius = 8},
  {name = "wp2", pos = vec3(150,250,50), radius = 8},
}
race_marker.setupMarkers(wps, "ringMarker")  -- or nil for default

-- Set which markers are visible and in what mode:
race_marker.setModes({wp1 = 'default', wp2 = 'next'})

-- Per-frame rendering:
race_marker.render(dt, dtSim)

-- Create a standalone marker (not in pool):
local custom = race_marker.createRaceMarker(true, "overhead")
custom:createMarkers()
custom:setToCheckpoint(myWaypoint)

Key Notes

  • Default marker type is sideColumnMarker (the most visually complex)
  • Markers are stored in ScenarioObjectsGroup for automatic level cleanup
  • The idToMarker table is also exposed as M.idToMarker (mutable reference)
  • Custom marker types are specified in scenario JSON via track.customMarker

See Also

  • Scenario Bus Driver - Bus Route Scenario Logic - Related reference
  • Scenario Damage Goal - Damage-Based Win/Fail Condition - Related reference
  • Scenario Demolition Derby - Last Vehicle Moving Wins - Related reference
  • Scenario System Guide - Guide

Quick Race Loader

Discovers available quick race tracks across all levels, loads track configurations, supports track editor tracks, and assembles complete scenario data for the quick race system.

Race Debug

Provides debug visualization for race waypoints and paths. Draws waypoint spheres and route prisms in the 3D world when editor mode and debug setting are enabled.

On this page

Public API (Exports)InternalsHow It WorksUsage ExampleKey NotesSee Also