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

On Vehicle Spawned

- **Node Name:** `On Vehicle Spawned`

Overview

  • Node Name: On Vehicle Spawned
  • Category: logic
  • File: extensions/flowgraph/nodes/vehicle/onVehicleSpawned.lua

Triggers when a new vehicle is spawned in the world. Fires an impulse with the spawned vehicle's ID.

Pin Schema

Input Pins

PinTypeDescription
flowflowInflow for this node

Output Pins

PinTypeDescription
flowflow (impulse)Fires once when a vehicle is spawned
vehIdnumberID of the vehicle that was spawned

Legacy Pin Mapping

  • out.vehicleID → vehId

Internals

Key Methods

MethodDescription
init()Empty initialization
_executionStarted()Resets flag and info table
onVehicleSpawned(id)Hook - stores spawned vehicle ID and sets flag
work()If flag is set, outputs vehicle ID and fires impulse, then clears flag
_afterTrigger()Clears the flag for single-frame impulse

How It Works

  1. The node subscribes to the onVehicleSpawned hook automatically.
  2. When any vehicle is spawned, onVehicleSpawned(id) stores the ID and sets a flag.
  3. On the next work() tick, the node outputs the ID and fires the flow impulse.
  4. The flag is cleared to ensure the impulse lasts exactly one frame.

Usage Example

-- In a flowgraph - react to any vehicle spawn:
-- [On Vehicle Spawned] → (vehId) → [Set AI Mode / Configure Vehicle]

-- The engine hook:
-- onVehicleSpawned(vehicleId)

Key Dependencies

  • onVehicleSpawned engine hook - fires when a new vehicle object is created

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

On Vehicle Reset

- **Node Name:** `On Vehicle Reset`

On Vehicle Switched

- **Node Name:** `On Vehicle Switched`

On this page

OverviewPin SchemaInput PinsOutput PinsLegacy Pin MappingInternalsKey MethodsHow It WorksUsage ExampleKey DependenciesSee Also