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
Drift Zone BoundsDrift Race PathDrift UI DisplayDrift Detection EngineDrift SystemDrift Quick MessagesDrift Save/LoadDrift ScoreboardDrift Scoring SystemDrift AudioDrift StallingDrift StatisticsDrift Stunt Zones

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 Extensionsgameplaydrift

Drift Statistics

Reference for `gameplay_drift_statistics`, which records drift performance metrics into the persistent statistics system (`gameplay_statistic`).

Reference for gameplay_drift_statistics, which records drift performance metrics into the persistent statistics system (gameplay_statistic).


Exports

FunctionSignatureDescription
onDriftCrash()Increments drift/crashes by 1
onDriftCompleted(data)Records drift chain stats: left/right drift counts, max distance, max time, max chained drifts
onDriftCompletedScored(data)Adds data.addedScore to drift/totalScore, updates drift/maxDriftScore
onDriftSpinout()Increments drift/spinOuts by 1

Statistics Tracked

MetricTypeDescription
drift/rightDriftsadditiveTotal right-hand drifts
drift/leftDriftsadditiveTotal left-hand drifts
drift/maxDriftDistance.lengthmaxLongest single drift chain distance
drift/maxDriftTime.timemaxLongest single drift chain time
drift/maxChainedDriftsmaxMost drifts chained together
drift/totalScoreadditiveCumulative drift score
drift/maxDriftScoremaxHighest single drift score
drift/spinOutsadditiveTotal spinouts
drift/crashesadditiveTotal crashes
M.onDriftCompleted(data)-
M.onDriftCompletedScored(data)-
M.onDriftCrash()-
M.onDriftSpinout()-

Key Behaviors

  • Uses gameplay_statistic.metricGet/metricSet/metricAdd for persistence
  • onDriftCompleted requires data.chainDriftData to be non-nil; skips if missing
  • Max stats use a helper that only updates if the new value exceeds the stored value

See Also

  • drift/bounds - Drift Zone Boundary Detection - Related reference
  • drift/destination - Race Path & Wrong-Way Detection - Related reference
  • drift/display - Drift UI & HUD Management - Related reference
  • Gameplay Systems Guide - Guide

Drift Stalling

Reference for `gameplay_drift_stallingSystem`, which penalizes repetitive drift behavior by reducing the score multiplier when the player repeats the same stunts without variety.

Drift Stunt Zones

Reference for `gameplay_drift_stuntZones`, which manages the lifecycle, detection, rendering, and scoring of drift stunt zones (donuts, drift-throughs, hit poles, near poles).

On this page

ExportsStatistics TrackedKey BehaviorsSee Also