RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
`adasUltrasonic.lua``cameraPreview.lua``capturePlayer.lua``license.lua``lidarTest.lua``multiscreen.lua``openDriveExporter.lua``openStreetMapExporter.lua``partAnnotations.lua``platoonFunctions.lua``pythonExport.lua``rawLidar.lua``rawLidarEmpty.lua``sensors.lua``sumoExporter.lua``techCore.lua``terrainImporter.lua``ultrasonicTest.lua``utils.lua`

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 Extensionstech

`ultrasonicTest.lua`

> This Source Code Form is subject to the terms of the bCDDL, v. 1.1.

This Source Code Form is subject to the terms of the bCDDL, v. 1.1. If a copy of the bCDDL was not distributed with this file, You can obtain one at http://beamng.com/bCDDL-1.1.txt

Module variable: M

Hooks

  • onExtensionUnloaded
  • onUpdate
  • onVehicleDestroyed

Exported Functions

M.onExtensionUnloaded()

Line 260

Returns: M

M.executeUltrasonicTest()

Line 24

New Tests Added-------------------------- local function createUltrasonic(vehicleid) local args = {updateTime = --(float): How often the ultrasonic sensor should update its readings in the simulator (in seconds). updatePriority = --(float): A scheduling priority value for this ultrasonic sensor, in range 0 to 1. 0 is highest priority, 1 is least. pos = --(Point3F): The position of the ultrasonic sensor either in vehicle space (if attached to vehicle) or in world space (if fixed to the map). dir = --(Point3F): The forward direction in which the ultrasonic sensor points. up = --(Point3F): The up direction of the ultrasonic sensor. size = --(table): The horizontal and vertical resolution of the ultrasonic sensor. fovY = --(float): The vertical field of view of the ultrasonic sensor, in degrees. nearFarPlanes = --(table): The near and far plane distances of the ultrasonic sensor, in metres. rangeRoundness = --(float): The general roundness of the ultrasonic sensors range shape. Can be negative. rangeCutoffSensitivity = --(float): A cutoff sensitivity parameter for the ultrasonic sensor range-shape. rangeShape = --(float): The shape of the ultrasonic sensor range-shape in the range [0, 1], going from conical to spherical. rangeFocus = --(float): The focus parameter for the ultrasonic sensor range-shape. rangeMinCutoff = --(float): The minimum cut-off distance for the ultrasonic sensor range-shape. Nothing closer than this will be detected. rangeDirectMaxCutoff = --(float): The maximum cut-off distance for the ultrasonic sensor range-shape. This parameter is a hard cutoff - nothing further than this will be detected, although other parameters can also control the maximum distance. sensitivity = --(float): The sensitivity of the ultrasonic sensor detection. fixedWindowSize = --(float): Used with sensitivity to set how sharply the ultrasonic sensor detects surfaces. isVisualised = --(bool): A flag which indicates if the ultrasonic sensor should be visualised. isStatic = --(bool): True if the ultrasonic sensor is fixed to a point on the map, false if it is attached to a vehicle. isSnappingDesired = --(bool): True if the ultrasonic sensor position should be forced onto the surface of the vehicle, at its closest vehicle point. This is useful if finding it hard to have the ultrasonic sensor on the vehicle itself. False, otherwise, eg if the ultrasonic sensor should be suspended at a fixed point relative to the vehicle. isForceInsideTriangle = --(bool): Used with isSnappingDesired. True, if the ultrasonic sensor should be forced to be inside its nearest vehicle triangle. Otherwise false. } local ultrasonicID = extensions.tech_sensors.createUltrasonic(vehicleid,args) end Public interface.

M.onUpdate(dtReal, dtSim, dtRaw)

Line 181

Trigger execution to access the ultrasonic test class in every update cycle.

M.onVehicleDestroyed(vid)

Line 198

If a vehicle is destroyed, remove any attached sensors.

Exported Variables

M.onExtensionLoaded

Line 259 - onExtensionUnloaded

M.createUltrasonic

Line 261 - createUltrasonic

Internal Functions

Show internal functions
  • executeUltrasonicTest() (line 24)

    The ultrasonic test.

  • onUpdate(dtReal, dtSim, dtRaw) (line 181)

    Trigger execution to access the ultrasonic test class in every update cycle.

  • onVehicleDestroyed(vid) (line 198)

    If a vehicle is destroyed, remove any attached sensors.

  • onExtensionLoaded() (line 203)

`terrainImporter.lua`

> This Source Code Form is subject to the terms of the bCDDL, v. 1.1.

`utils.lua`

> This Source Code Form is subject to the terms of the bCDDL, v. 1.1.

On this page

HooksExported FunctionsM.onExtensionUnloaded()M.executeUltrasonicTest()M.onUpdate(dtReal, dtSim, dtRaw)M.onVehicleDestroyed(vid)Exported VariablesM.onExtensionLoadedM.createUltrasonicInternal Functions