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
Crash Test BoundariesCrash Test CountdownCrash Test ScoringCrash Test Task ListCrash Test Scenario Manager

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 ExtensionsgameplaycrashTest

Crash Test Boundaries

Reference for `gameplay_crashTest_crashTestBoundaries`, which manages spatial boundaries for crash test missions. Checks whether the player vehicle is inside designated zones and triggers out-of-bound

Reference for gameplay_crashTest_crashTestBoundaries, which manages spatial boundaries for crash test missions. Checks whether the player vehicle is inside designated zones and triggers out-of-bounds events.


Overview

This extension loads boundary zones from .sites.json files and performs per-frame checks to determine if the player vehicle remains within the allowed area. When out of bounds, it notifies the scenario manager and draws visual boundary indicators.


Exports

FunctionSignatureDescription
onUpdate()Per-frame check: tests player position, draws bounds if enabled
setParameters(params)Load boundary zones from a sites file
setDebug(debug)Enable/disable debug mode
onNewCrashTestStep(stepData)Load step-specific or default boundary file
deactivateBounds()Clear active boundary zones
M.deactivateBounds()-
M.onNewCrashTestStep(stepData)-
M.onUpdate()-
M.setDebug(debug)-
M.setParameters(params)-

Internals

  • sites - Loaded via gameplay_sites_sitesManager.loadSites(), contains zone definitions
  • isPlayerOutOfBounds - Boolean flag updated each frame
  • drawBoundsWhenNear - When true, draws boundary zone outlines near the player

Boundary Loading

setParameters({filePath = "..."}) loads a sites file and finalizes the zones. Passing nil filePath clears the boundaries.

Each crash test step can have its own boundary file (boundsStep<id>.sites.json) or fall back to the default bounds.sites.json.

Out-of-Bounds Detection

Each frame, the extension checks the player vehicle's spawn OOBB points against all loaded zones. If any OOBB point falls outside all zones, the player is marked as out of bounds and gameplay_crashTest_scenarioManager.onPlayerOutOfBounds() is called.


How It Works

  1. When a crash test step begins, onNewCrashTestStep(stepData) loads the appropriate boundary file
  2. onUpdate() runs every frame - checks player OOBB against zones
  3. If out of bounds, the scenario manager is notified (typically fails the step)
  4. Zone outlines are drawn with a flashing red/white color based on boundary status
-- Load boundaries from a sites file
gameplay_crashTest_crashTestBoundaries.setParameters({
  filePath = "/missions/crashTest/bounds.sites.json"
})

-- Clear boundaries
gameplay_crashTest_crashTestBoundaries.deactivateBounds()

Key Behaviors

  • Boundary zones flash red when the player is out of bounds, white when inside
  • The drawBoundsWhenNear flag defaults to true if not specified in parameters
  • Step-specific boundary files use the naming convention boundsStep<stepId>.sites.json
  • The mission-relative path is resolved via the foreground mission's manager

See Also

  • crashTestCountdown - Crash Test Countdown Timer - Related reference
  • crashTestScoring - Crash Test Score Calculation - Related reference
  • crashTestTaskList - Crash Test UI Task List - Related reference
  • Gameplay Systems Guide - Guide

G2G Activity

Background activity that spawns random vehicles into the world. Uses a step-based sequence with fade-to-black transitions for vehicle spawning.

Crash Test Countdown

Reference for `gameplay_crashTest_crashTestCountdown`, a simple countdown timer that displays a visual countdown and plays audio cues before a crash test step begins.

On this page

OverviewExportsInternalsBoundary LoadingOut-of-Bounds DetectionHow It WorksKey BehaviorsSee Also