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
Donut ZoneDrift Through ZoneHit Pole ZoneNear Pole Zone

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 ExtensionsgameplaydriftstuntZones

Drift Through Zone

Reference for the drift-through stunt zone class, loaded via `require("gameplay/drift/stuntZones/driftThrough")`.

Reference for the drift-through stunt zone class, loaded via require("gameplay/drift/stuntZones/driftThrough").


Overview

An oriented rectangular zone that scores when the player drifts through it (enters, exits, and the exit triggers the score). Returns a class factory function.


Factory

return function(data) → driftThroughInstance

Class Methods

MethodSignatureDescription
init(data)Stores zone data, calls reset
reset()Resets activeData: cooldown=0, usedFlag=false
accomplish()Resets usedFlag, sets cooldown, fires onAnyStuntZoneAccomplished → onDriftThroughAccomplished with currDegAngle
detectStunt()If usedFlag is true (player was outside), accomplishes
isAvailable()Returns currCooldown <= 0
isPlayerInside()OBB containment check; sets usedFlag=true when player leaves
onUpdate()Calls sendDecals
sendDecals()Draws two parallel lines with cooldown coloring using lerp

Key Behaviors

  • Uses containsOBB_point for oriented bounding box detection
  • The zone must be exited to set usedFlag, then re-entered to score
  • Decal rendering shows two gate lines with green/red/white cooldown states
  • currDegAngle falls back to 30 if drift data unavailable (for debug testing)

See Also

  • drift/stuntZones/donut - Donut Stunt Zone - Related reference
  • drift/stuntZones/hitPole - Hit Pole Stunt Zone - Related reference
  • drift/stuntZones/nearPole - Near Pole Stunt Zone - Related reference
  • Gameplay Systems Guide - Guide

Donut Zone

Reference for the donut stunt zone class, loaded via `require("gameplay/drift/stuntZones/donut")`.

Hit Pole Zone

Reference for the hit-pole stunt zone class, loaded via `require("gameplay/drift/stuntZones/hitPole")`.

On this page

OverviewFactoryClass MethodsKey BehaviorsSee Also