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
Collection Marker (Flowgraph Node)Custom Lua Command (Flowgraph Node)Get Object Field (Flowgraph Node)Get Player Vehicle ID (Flowgraph Node)Get Point on Decalroad (Flowgraph Node)Show/Hide Object (Flowgraph Node)ID by Name (Flowgraph Node)Keep Prefab (Flowgraph Node)Particle Emitter (Flowgraph Node)Point on Decalroad (Flowgraph Node)Raceline Parking (Flowgraph Node)Raycast (Flowgraph Node)Parking Markers / Rect Marker (Flowgraph Node)Reload Collision (Flowgraph Node)Reload Nav Graph (Flowgraph Node)Remove Prefab (Flowgraph Node)Reset Prefab (Flowgraph Node)Set Object Field (Flowgraph Node)Sevensegment Display (Flowgraph Node)Single Marker (Flowgraph Node)Spawn Light / SpotLight (Flowgraph Node)Spawn Prefab (Flowgraph Node)Spawn TSStatic (Flowgraph Node)Store Statics (Flowgraph Node)Track Prefab (Flowgraph Node)

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 Extensionsflowgraphnodesscene

Spawn Light / SpotLight (Flowgraph Node)

- **Node Name:** `SpotLight`

Overview

  • Node Name: SpotLight
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/scene/spawnLight.lua

Creates and manages a spotlight in the scene with configurable position, rotation, color, and beam properties.

Pin Schema

Input Pins

PinTypeDescription
updateflowUpdates spotlight position/properties when receiving flow
clearflow (impulse)Clears the spotlight
positionvec3Spotlight position
rotationquatSpotlight rotation
rangenumber(Hidden) Light range (default 20)
innerAnglenumber(Hidden) Inner cone angle (default 15)
outerAnglenumber(Hidden) Outer cone angle (default 45)
colorcolorLight color
brightnessnumber(Hidden) Light brightness (default 1)

Output Pins

PinTypeDescription
createdflow (impulse)Fires when the spotlight is created
lastIdnumberID of the most recently created light

Internals

FieldDefaultPurpose
self.objects{}List of spawned SpotLight objects
self.data.maxObjectCount1Maximum number of lights to create

Behavior

  • work() - Each frame:
    • On clear, deletes all lights.
    • If fewer lights than maxObjectCount, creates a new one via createObject().
    • If exactly 1 light and update flow is active, updates all properties in place.
  • createObject() - Uses worldEditorCppApi.createObject("SpotLight") and sets position, rotation, angles, brightness, range, and color.
  • clearObjects() - Deletes all spawned lights and clears the list.

How It Works

  1. On first trigger, creates a SpotLight via the world editor API (not createObject() - uses worldEditorCppApi).
  2. The light is configured with all input properties and flagged as canSave = false.
  3. When update flow is active with a single light, all properties are dynamically updated each frame.
  4. Cleanup occurs on execution stop, mission end, or node destruction.

Key Dependencies

  • worldEditorCppApi.createObject("SpotLight") - creates the light object
  • editor.onAddSceneTreeObjects() / onRemoveSceneTreeObjects() - editor integration

Additional Methods

C:_executionStopped()

Called when graph execution stops. Used for cleanup.

C:destroy()

Destroys the node and cleans up any created objects.

C:init(mgr, ...)

Initializes the node, setting up pins and default properties.

Parameters:

  • mgr
  • ...

C:onClientEndMission()

Cleanup callback when the mission/level ends.


See Also

  • Collection Marker (Flowgraph Node) - Related reference
  • Custom Lua Command (Flowgraph Node) - Related reference
  • Get Object Field (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Single Marker (Flowgraph Node)

- **Node Name:** `Single Marker`

Spawn Prefab (Flowgraph Node)

- **Node Name:** `Spawn Prefab`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsBehaviorHow It WorksKey DependenciesAdditional MethodsC:_executionStopped()C:destroy()C:init(mgr, ...)C:onClientEndMission()See Also