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 DetectionDamage AssessmentGround ContactSorted List

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 Extensionsgameplayutil

Ground Contact

Reference for `gameplay_util_groundContact`, a simple utility that checks whether a vehicle is resting on its wheels (right-side-up and touching the ground).

Reference for gameplay_util_groundContact, a simple utility that checks whether a vehicle is resting on its wheels (right-side-up and touching the ground).


Module Exports (M)

FunctionSignatureDescription
isOnWheels(vehId) → boolReturns true if the vehicle's bottom is within ground contact distance

Internals

Detection Method

  1. Gets the vehicle's oriented bounding box (OOBB) center position
  2. Adjusts Z position to the bottom of the bounding box + 0.3m offset
  3. Casts a static ray downward (1.5m max length)
  4. Returns true if the ray hits within 1.1m

Constants

ConstantValueDescription
raycastLength1.5Maximum downward ray distance
maxGroundDistance1.1Maximum distance to consider "on wheels"
Z offset+0.3Offset from bottom of OOBB for ray origin
M.isOnWheels(vehId)-

Requirements

  • Requires map.objects[vehId] to exist (vehicle must be in the map system)
  • Uses castRayStatic for ground detection (only checks static geometry, not other vehicles)

How It Works

The function checks if the bottom of the vehicle's bounding box is close to static ground geometry. The 0.3m offset from the OOBB bottom accounts for wheel/suspension travel. If the downward raycast hits within 1.1m, the vehicle is considered to be resting on its wheels.

This is a simple check - it doesn't verify individual wheel contact or distinguish between being on wheels vs being on the roof near the ground.


Usage Example

-- Check if player vehicle is on its wheels
local vehId = be:getPlayerVehicleID(0)
if gameplay_util_groundContact.isOnWheels(vehId) then
  log("I", "", "Vehicle is on its wheels")
else
  log("I", "", "Vehicle is flipped or airborne")
end

See Also

  • gameplay/util/crashDetection - Vehicle Crash Detection System - Related reference
  • gameplay/util/damageAssessment - Vehicle Damage Location Assessment - Related reference
  • gameplay/util/sortedList - Sorted Object List Container - Related reference
  • Gameplay Systems Guide - Guide

Damage Assessment

Reference for `gameplay_util_damageAssessment`, which provides spatial damage analysis by dividing a vehicle's bounding box into a 3×3×3 grid (27 sections) and determining which body regions sustained

Sorted List

Reference for `gameplay_util_sortedList`, a generic container that manages a list of named, ID-bearing objects with sorted ordering, name-based lookup, and serialization support.

On this page

Module Exports (M)InternalsDetection MethodConstantsRequirementsHow It WorksUsage ExampleSee Also