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 Pacenote

Object class representing a pacenote (audio/visual cue) along a race path. Pacenotes have a position, radius, directional normal, and associated text note. Used for co-driver callouts.

Object class representing a pacenote (audio/visual cue) along a race path. Pacenotes have a position, radius, directional normal, and associated text note. Used for co-driver callouts.


Constructor

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

Public API

MethodSignatureReturnsDescription
init(path, name, forceId)nilInitializes pacenote with path reference, name, and optional forced ID
setNormal(normal)nilSets directional normal (normalized); nil resets to (0,1,0)
setManual(pos, radius, normal)nilSets manual position, radius, and normal
setNavgraph(navgraphName, fallback)nilSets position from a navgraph node
inside(pos)boolTests if a position is inside the pacenote sphere (and normal check)
intersectCorners(fromCorners, toCorners)hit, tRay-sphere + ray-plane intersection for vehicle corners
onSerialize()tableSerializes to JSON-ready table
onDeserialized(data, oldIdMap)nilRestores from serialized data
drawDebug(drawMode, clr, extraText)nilRenders debug visualization

Internals

FieldTypeDescription
pathPathReference to parent path object
idnumberUnique identifier within the path
namestringDisplay name
posvec3World position
normalvec3Directional normal vector
radiusnumberTrigger sphere radius
notestringText content of the pacenote
segmentnumberAssociated segment ID (-1 if unassigned)
sortOrdernumberSort order for display
modestring"manual" or "navgraph"

How It Works

  1. Pacenotes define trigger volumes (sphere + optional half-plane via normal) along a race path
  2. inside() checks distance to center and optionally validates the position is on the correct side of the normal plane
  3. intersectCorners() tests vehicle wheel corner movement against the sphere using ray-sphere and ray-plane intersection for precise frame-accurate detection
  4. Serialization preserves position, radius, normal, note text, and linked segment

Usage Examples

-- Create a pacenote
local pn = Pacenote(myPath, "Turn 3 Left")
pn:setManual(vec3(100, 200, 50), 15, vec3(1, 0, 0))
pn.note = "Left 3 tightens"

-- Check if vehicle is inside
if pn:inside(vehiclePos) then
  -- trigger audio callout
end

-- Serialize for saving
local data = pn:onSerialize()

Notes

  • Part of the race path system alongside pathnode, segment, and startPosition
  • The intersectCorners method uses both sphere intersection and plane intersection for directional pacenotes
  • Debug drawing uses rainbow coloring based on sort order

See Also

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

Vehicle Conditions

Reference for vehicle-based unlock condition types used by the mission unlock system.

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

On this page

ConstructorPublic APIInternalsHow It WorksUsage ExamplesNotesSee Also