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
AI ParametersAI ArriveAI ChaseAI Directly ToAI DisableAI FleeAI FollowAI Follow WaypointsGet AI ModeAI Go To The End LineAI RandomFollow DecalroadAI StopAI Traffic

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 Extensionsflowgraphnodesvehicleai

AI Traffic

- **Node Name:** `AI Traffic`

Overview

  • Node Name: AI Traffic
  • Category: once_p_duration
  • File: extensions/flowgraph/nodes/vehicle/ai/traffic.lua

Sets a vehicle's AI to drive following traffic rules. Note: This only sets the individual vehicle's AI mode - it does not enable the traffic management system.

Pin Schema

Input Pins

PinTypeDescription
aiVehIdnumberVehicle ID to set to traffic AI mode. Uses player vehicle if empty.

Internals

Key Methods

MethodDescription
workOnce()Resolves the vehicle and queues ai.setMode("traffic") on it.

How It Works

  1. workOnce() fires once when the node receives flow.
  2. Resolves the vehicle from aiVehId or falls back to the player vehicle.
  3. Sends ai.setMode("traffic") to the vehicle's Lua VM.
  4. The vehicle AI then follows traffic rules (speed limits, signals, lanes) but operates independently of the traffic management system.

Important: This node uses ai.setMode() (not ai.setState()) - a slightly different API than other AI nodes.

Usage Example

-- Flowgraph:
-- [Spawn Vehicle] → vehId → [AI Traffic] → continues...

-- Equivalent vehicle-side command:
ai.setMode("traffic")

-- To also enable the full traffic system, use:
-- gameplay_traffic.setupTraffic()

Key Dependencies

  • ai.setMode("traffic") - vehicle-side AI mode setter

See Also

  • AI Parameters (Flowgraph Node) - Related reference
  • AI Arrive (Flowgraph Node) - Related reference
  • AI Chase (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

AI Stop

- **Node Name:** `AI Stop`

AI Follow Path from Data

- **Node Name:** `AI Follow Path from Data`

On this page

OverviewPin SchemaInput PinsInternalsKey MethodsHow It WorksUsage ExampleKey DependenciesSee Also