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 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.

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.


Public API

FunctionSignatureDescription
M.onScenarioChange(scenario)Builds debug path by computing routes between waypoints
M.onDrawDebug(focusPos)Renders waypoint spheres and path prisms when debug enabled

Internals

Path Building (onScenarioChange)

  1. Gets the current scenario's lapConfig waypoint list
  2. For each consecutive pair of waypoints, calls map.getPath(from, to)
  3. Stores the resulting path nodes in scenario.debugPath
  4. Copies node data (position, radius) into scenario.debugNodes
  5. Marks nodes as direct if the path segment is a single hop

Debug Drawing (onDrawDebug)

Only draws when both:

  • $isEditorEnabled == 1 (editor mode active)
  • settings.getValue("BeamNGRaceDrawDebug") is true

Renders:

  • Red spheres at each lap config waypoint with its radius
  • Text labels showing waypoint index (e.g., "wp 3/12")
  • Green square prisms connecting debug path nodes (route visualization)
  • Red prisms for direct connections (no intermediate road nodes)

How It Works

  1. onScenarioChange triggers when a scenario starts running
  2. Iterates through lapConfig waypoints and finds road-level paths between them
  3. onDrawDebug is called each frame by the debug draw system
  4. Uses debugDrawer to render spheres, text, and square prisms along the route

Usage Examples

-- Enable race debug visualization
-- 1. Enter editor mode (F11)
-- 2. Enable the setting:
settings.setValue("BeamNGRaceDrawDebug", true)

-- The debug overlay will appear automatically during any running scenario

Key Notes

  • Debug-only tool - has no effect on gameplay
  • Uses map.getPath for road-level pathfinding between waypoints
  • Square prisms width scales with waypoint radius
  • Direct connections (single-hop paths) drawn in red vs green for routed paths
  • Path data stored on the scenario object itself (scenario.debugPath, scenario.debugNodes)

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

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.

Race Goals Manager

Central manager that initializes, validates, and dispatches race goal events to individual goal modules. Acts as the bridge between the scenario system and goal implementations.

On this page

Public APIInternalsPath Building (onScenarioChange)Debug Drawing (onDrawDebug)How It WorksUsage ExamplesKey NotesSee Also