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 Flee

- **Node Name:** `AI Flee`

Overview

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

Sets a vehicle's AI to flee from another vehicle. The AI will drive away from the target, trying to maximize distance.

Pin Schema

Input Pins

PinTypeDefaultDescription
aiVehIdnumber-Vehicle ID to apply AI flee mode (uses player vehicle if empty)
targetIdnumber-Vehicle ID of the vehicle to flee from (defaults to player vehicle)

Internals

Key Methods

MethodDescription
workOnce()Sets AI mode to "flee" and assigns the target vehicle

Commands Sent

ai.setMode("flee")
ai.setTargetObjectID(targetId)

How It Works

  1. Resolves the AI vehicle by aiVehId or defaults to the player vehicle.
  2. Resolves the target by targetId or defaults to player vehicle ID.
  3. Queues two Lua commands: set mode to "flee" and set target object ID.
  4. Executes once, then the AI continues fleeing autonomously.

Usage Example

-- Make vehicle 5 flee from the player:
-- aiVehId = 5
-- targetId = (empty, defaults to player)

-- Make vehicle 5 flee from vehicle 3:
-- aiVehId = 5
-- targetId = 3

Key Dependencies

  • ai.setMode("flee") - enables flee AI mode
  • ai.setTargetObjectID() - sets the vehicle to flee from

See Also

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

AI Disable

- **Node Name:** `AI Disable`

AI Follow

- **Node Name:** `AI Follow`

On this page

OverviewPin SchemaInput PinsInternalsKey MethodsCommands SentHow It WorksUsage ExampleKey DependenciesSee Also