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
Drag Race DebugDrag Tree DisplayDrag Race APIDrag Racing ManagerDrag Strip Save SystemDrag Race TimingDrag Race Phases
Bracket Drag RaceDrag Practice RaceHeads-Up Drag Race

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 ExtensionsgameplaydragdragTypes

Heads-Up Drag Race

Reference for `gameplay_drag_dragTypes_headsUpDrag`, which implements a two-racer heads-up drag race with no handicap.

Reference for gameplay_drag_dragTypes_headsUpDrag, which implements a two-racer heads-up drag race with no handicap.


Overview

Heads-up racing is the classic drag format - both vehicles launch simultaneously from a shared tree with no dial offset. The first to cross the finish line wins (unless disqualified). Phase progression uses dependency-based synchronisation identical to the bracket race type.


Dependencies

gameplay_drag_general, gameplay_drag_utils


Exports

| Function | Signature | Description | |------ | M.dependencies | table | {"gameplay_drag_general", "gameplay_drag_utils"} |----|-----------|-------------| | onExtensionLoaded | () | Caches module references, clears state | | onUpdate | (dtReal, dtSim, dtRaw) | Main loop - updates racers, runs phase logic | | startDebugPhase | (pIndex, dData) | Jump all racers to a specific phase for testing | | startActivity | () | Begin the race; sets dial = 0 for all racers | | resetDragRace | () | Delegates to general reset, clears local flags |


Internals

SymbolPurpose
hasActivityStartedGate for the update loop
debugStartFlag for debug-phase jumping

How It Works

-- Start a heads-up race (both racers get dial = 0)
gameplay_drag_dragTypes_headsUpDrag.startActivity()

-- Phase progression:
-- 1. updateRacer(racer) - position, speed, wheels
-- 2. Execute phase function: dUtils[phase.name](phase, racer, dtSim)
-- 3. Non-dependency phases: advance racer individually
-- 4. Dependency phases: wait for ALL racers, then advance all together

The key difference from bracket race:

  • Bracket: dials come from racer.timers.dial.value (staggered start)
  • Heads-up: all dials are forced to 0 (simultaneous start)

Key Behaviors

  • Dependency phases (stage, countdown) synchronise both racers
  • Independent phases (race, stop) let each racer finish at their own pace
  • Activity is finished when every racer has isFinished == true
  • dragData.isCompleted is set on finish
  • Phase functions (stage, countdown, race, stop) are defined in gameplay_drag_utils
  • Win condition uses headsUpWin() in utils - sorted by raw time, disqualified last

Module Variables

VariableTypeDescription
M.dependenciestable{"gameplay_drag_general", "gameplay_drag_utils"}
M.onExtensionLoaded()-
M.onUpdate(dtReal, dtSim, dtRaw)-
M.resetDragRace()-
M.startActivity()-
M.startDebugPhase(pIndex, dData)-

See Also

  • drag/dragTypes/bracketRace - Bracket Race Type - Related reference
  • drag/dragTypes/dragPracticeRace - Solo Practice Drag Race - Related reference
  • Gameplay Systems Guide - Guide

Drag Practice Race

Reference for `gameplay_drag_dragTypes_dragPracticeRace`, which implements a single-player practice drag race with automatic cleanup.

Drift Zone Bounds

Reference for `gameplay_drift_bounds`, which detects whether the drift vehicle is inside defined zone boundaries and optionally draws them.

On this page

OverviewDependenciesExportsInternalsHow It WorksKey BehaviorsModule VariablesSee Also