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
Route Distance (Flowgraph Node)Closest Road (Flowgraph Node)Custom Lua (Flowgraph Node)Distance Between (Flowgraph Node)Waypoints Distance (Flowgraph Node)File Exists (Flowgraph Node)Get First Element of Table (Flowgraph Node)Get Level Data (Flowgraph Node)Get Map Objects IDs by DynField (Flowgraph Node)Get Table Value By Key (Flowgraph Node)GHOST (Flowgraph Node)Hide Loading Screen (Flowgraph Node)Color HSV (Flowgraph Node)Line Point From Xnorm (Flowgraph Node)Load Level (Flowgraph Node)Load Project (Flowgraph Node)On Menu (Flowgraph Node)Perlin Noise (Flowgraph Node)Pop Action Map (Flowgraph Node)Get Project InfoPush Action MapRandom ColorRandom NumberRandom QuaternionRandom VectorRoad PropertiesGet Navgraph RouteRoute PositionTemplate NodeTimeTimed SequenceTo NumberTo StringWorld Editor Open

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 Extensionsflowgraphnodesutil

Random Vector

- **Node Name:** `Random Vector`

Overview

  • Node Name: Random Vector
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/util/randomVector.lua

Generates a random 3D vector (not normalized) by independently randomizing each axis within min/max bounds. Outputs a new vector every frame.

Pin Schema

Input Pins

PinTypeDefaultDescription
xMinnumber-1Minimum value for the X axis (hardcoded)
xMaxnumber1Maximum value for the X axis (hardcoded)
yMinnumber-1Minimum value for the Y axis (hardcoded)
yMaxnumber1Maximum value for the Y axis (hardcoded)
zMinnumber-1Minimum value for the Z axis (hardcoded)
zMaxnumber1Maximum value for the Z axis (hardcoded)

Output Pins

PinTypeDescription
vectorvec3The random vector value (as table {x,y,z})

Internals

Key Methods

MethodDescription
work()Generates a random vec3 from per-axis min/max ranges

Vector Construction

Each axis uses lerp(min, max, math.random()) to produce a uniformly distributed random value within the range. The result is output as a table {x, y, z}.

How It Works

  1. Each frame, three independent random values are generated (one per axis).
  2. lerp linearly interpolates between min and max using math.random() (0–1).
  3. The vector is not normalized - its magnitude depends on the input ranges.
  4. Output as a plain table {x, y, z} on the vector pin.

Usage Example

-- Random position in a 10x10x0 area (flat ground):
-- xMin = -5, xMax = 5
-- yMin = -5, yMax = 5
-- zMin = 0, zMax = 0

-- Random offset for spawning objects:
-- xMin = -2, xMax = 2
-- yMin = -2, yMax = 2
-- zMin = 0, zMax = 5

Key Dependencies

  • lerp() - linear interpolation helper

See Also

  • Route Distance (Flowgraph Node) - Related reference
  • Closest Road (Flowgraph Node) - Related reference
  • Custom Lua (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Random Quaternion

- **Node Name:** `Random Quaternion`

Road Properties

- **Node Name:** `Road Properties`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsKey MethodsVector ConstructionHow It WorksUsage ExampleKey DependenciesSee Also