RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage
Align For CouplingApply Velocity to VehicleBoost VehicleSet Vehicle ColorsCustom Parts Config ProviderEnter VehicleFlip UprightFreeze VehicleGenerate License PlateGet Vehicle ActiveGet Electrics ValueGet GearboxmodeGet Powertrain DataGravity ForceDistance From GroundHas Coupler TagIs CoupledIs Player UsableKeep VehicleMove Vehicle ToOn Cannon FiredOn Vehicle DestroyedOn Vehicle ResetOn Vehicle SpawnedOn Vehicle SwitchedPlayer UsableRandom Config ProviderRecover In PlaceRemove VehicleTimeline ReplaySet Vehicle ActiveSet Gearbox ModeSet IgnitionSet License PlateSet LightbarSet LightsShift to Gear IndexSpawn VehicleVehicle StatesTeleport To Last RoadToggle Vehicle ControlsMove To ShowroomVehicle TouchProps TouchStatic Object TouchTrack VehicleTrailer Respawn ControlVehicle Config ProviderGet Vehicle DataGet Vehicle DataGet Vehicle BoundsVehicle PingGet Vehicle Wheel Center

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 Extensionsflowgraphnodesvehicle

Static Object Touch

- **Node Name:** `Static Object Touch`

Overview

  • Node Name: Static Object Touch
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/vehicle/touchingStatic.lua

Detects if a vehicle is intersecting with static objects or terrain by casting rays from the vehicle's center toward 8 bounding-box perimeter points.

Pin Schema

Input Pins

PinTypeDescription
vehIdnumberID of the vehicle to check.
widthOffsetnumberWidth offset relative to vehicle (hidden).
lengthOffsetnumberLength offset relative to vehicle (hidden).
heightOffsetnumberHeight offset from ground (hidden, default 0.5).
debugModeboolDisplay debug drawings for collision checks (hidden).

Output Pins

PinTypeDescription
touchingflowActive when any static collision is detected.
touchFL–touchLflowPer-direction collision (FL, F, FR, R, BR, B, BL, L - all hidden).
isTouchingboolTrue while any collision is active (hidden).

Internals

Key Methods

MethodDescription
init()Calls reset().
_executionStarted()Allocates vec3 structures for the 8 perimeter points and center.
_executionStopped()Cleans up allocated vectors and resets state.
reset()Sets all output pins to false.
work()Computes 8 perimeter points from the OOBB, casts rays from center, and sets per-direction outputs.
onPreRender()Draws debug spheres (green/red) when debug mode is enabled.

How It Works

  1. Gets the vehicle's spawn world OOBB (Oriented Object Bounding Box).
  2. Computes 8 perimeter points (4 corners + 4 edge midpoints) with configurable offsets.
  3. For each point, casts a ray from the vehicle center using castRayStatic().
  4. If the ray hits something before reaching the perimeter point, that direction registers as touching.
  5. Sets individual per-direction flow pins and the aggregate touching/isTouching outputs.
  6. In debug mode, renders coloured spheres at each check point (red = hit, green = clear).

Usage Example

-- Flowgraph:
-- [Vehicle ID] → vehId → [Static Object Touch]
--                              ↓ touching → [Wall Hit Penalty]
--                              ↓ touchF   → [Front Impact Logic]

-- Equivalent GE Lua raycast:
local center = veh:getSpawnWorldOOBB():getCenter()
local frontPoint = -- computed from OOBB
local dist = frontPoint:distance(center)
local hitDist = castRayStatic(center, frontPoint - center, dist)
if hitDist <= dist then
  -- front is touching a static object
end

Key Dependencies

  • veh:getSpawnWorldOOBB() - oriented bounding box
  • castRayStatic() - engine raycast against static geometry and terrain
  • debugDrawer - visual debug rendering

See Also

  • Align for Coupling (Flowgraph Node) - Related reference
  • Apply Velocity to Vehicle (Flowgraph Node) - Related reference
  • Boost Vehicle (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Props Touch

- **Node Name:** `Props Touch`

Track Vehicle

- **Node Name:** `Track Vehicle`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsKey MethodsHow It WorksUsage ExampleKey DependenciesSee Also