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
Race PacenoteRace PathRace PathnodeRaceRace SegmentRace Start Position

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 Extensionsgameplayrace

Race Pathnode

Object class representing a checkpoint (pathnode) along a race path. Defines a trigger sphere with optional directional normal, side padding, visibility, and recovery positions.

Object class representing a checkpoint (pathnode) along a race path. Defines a trigger sphere with optional directional normal, side padding, visibility, and recovery positions.


Constructor

local Pathnode = require('/lua/ge/extensions/gameplay/race/pathnode')
local pn = Pathnode(path, name, forceId)

Public API

MethodSignatureReturnsDescription
init(path, name, forceId)nilInitializes pathnode with defaults
setNormal(normal)nilSets directional normal; nil clears it
setManual(pos, radius, normal)nilSets manual position, radius, and normal
setNavgraph(navgraphName, fallback)nilSets position from navgraph node
setNavRadiusScale(scl)nilScales navgraph radius
inside(pos)boolTests if position is within trigger sphere
intersectCorners(fromCorners, toCorners)hit, tRay-sphere/plane intersection for vehicle corners
getRecovery()startPosReturns linked recovery start position
getReverseRecovery()startPosReturns linked reverse recovery start position
getPaddedCenter()pos, midWidthReturns padded center position and width
getSideTransforms(posOffset, rotOffset, sclOffset, alignMode)tableRaycasts for side decoration transforms
setRoutePoint / getRoutePoint(rp)rpDynamic route point reference
setStaticRoutePoint / getStaticRoutePoint(rp)rpStatic route point reference
onSerialize / onDeserializedSerialization support
drawDebug(drawMode, clr, extraText)nilDebug visualization

Internals

FieldTypeDescription
pathPathParent path reference
idnumberUnique ID within path
modestring"manual" or "navgraph"
posvec3World position
radiusnumberTrigger sphere radius
normalvec3/nilDirectional normal
hasNormalboolWhether normal is active
visibleboolWhether this is a visible checkpoint
useAsSplitboolWhether used as a split time point
recoverynumberID of recovery start position
reverseRecoverynumberID of reverse recovery start position
sidePaddingvec3Left/right padding for gate width
customFieldsCustomFieldsExtensible custom data (e.g., aiAggression)

How It Works

  1. A pathnode defines a checkpoint trigger as a sphere with optional directional half-plane
  2. inside() checks distance, and if hasNormal, also checks the dot product with the normal
  3. intersectCorners() tests ray-sphere for non-directional nodes, or ray-sphere + ray-plane for directional nodes
  4. getSideTransforms() raycasts downward from the left and right edges to place side decorations (aligned to terrain, pathnode, or absolute)
  5. customFields allows arbitrary per-node data (used by the editor for AI aggression values, etc.)

Usage Examples

-- Create a directional checkpoint
local pn = Pathnode(path, "Hairpin")
pn:setManual(vec3(100, 200, 0), 15, vec3(0, 1, 0))
pn.visible = true
pn.useAsSplit = true

-- Test if vehicle passed through
local hit, t = pn:intersectCorners(prevCorners, currCorners)
if hit then
  print("Checkpoint reached at t=" .. t)
end

Notes

  • Non-visible pathnodes act as invisible segment connectors (still track progress but don't trigger events)
  • navRadiusScale allows scaling the radius when using navgraph-sourced positions
  • customFields is initialized from gameplay/sites/customFields module
FunctionSignatureReturnsDescription
M.convertRayHitToTransform(hit, pRot, zOff, scl, side, alignMode)nilconvertRayHitToTransform

See Also

  • Race Pacenote - Related reference
  • Race Path - Related reference
  • Race - Related reference
  • Gameplay Systems Guide - Guide

Race Path

Core class representing a complete race path. Contains sorted lists of pathnodes, segments, start positions, and pacenotes. Handles auto-configuration, AI path generation, serialization, and importing

Race

Core race management class that tracks vehicle progress through a race path, handles lap counting, segment transitions, checkpoint timing, AI vehicles, recovery, off-track detection, and integration w

On this page

ConstructorPublic APIInternalsHow It WorksUsage ExamplesNotesSee Also