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
Bool (Flowgraph Node)Color (Flowgraph Node)Generic Set/Get Variable (Flowgraph Node)Get Variable (Flowgraph Node)Number (Flowgraph Node)Quat (Flowgraph Node)Set Variable (Flowgraph Node)String (Flowgraph Node)Transform (Flowgraph Node)Vec3 (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 Extensionsflowgraphnodestypes

Vec3 (Flowgraph Node)

- **Node Name:** `Vec3`

Overview

  • Node Name: Vec3
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/types/vec3.lua

Constructs a 3D vector from x/y/z components, or converts a quaternion to a forward direction vector.

Pin Schema

Input Pins

PinTypeDescription
xnumberThe x component
ynumberThe y component
znumberThe z component
rotquat(Hidden) Optional quaternion - if connected, outputs the rotated Y-forward direction

Output Pins

PinTypeDescription
valuevec3The vector3 value (as {x, y, z} table)

How It Works

  1. work():
    • If rot is connected: rotates the Y-forward vector (0, 1, 0) by the quaternion and outputs the result.
    • Otherwise: outputs {x, y, z} from the numeric inputs (defaulting to 0).
  2. drawMiddle() - Shows the vector string representation inline on the node.

Internals

  • Uses module-level tempQuat, vecOut, and vecY to avoid per-frame allocation.
  • Output is a plain table {x, y, z}, not a vec3 userdata - standard flowgraph wire format.

Example Usage

-- Simple vector construction:
-- x=10, y=20, z=5 → output: {10, 20, 5}

-- Quaternion to forward direction:
-- Connect a quat to the 'rot' pin
-- Output: rotated (0,1,0) direction vector

-- Equivalent to:
local q = quat(rx, ry, rz, rw)
local forward = vec3(0, 1, 0):rotated(q)
self.pinOut.value.value = {forward.x, forward.y, forward.z}

Additional Methods

C:_onDeserialized(nodeData)

Called after the node is deserialized (loaded from file). Restores runtime state from saved data.

Parameters:

  • nodeData

C:_onSerialize(res)

Called when the node is serialized (saved to file). Returns data to persist.

Parameters:

  • res

C:drawProperties()

Custom ImGui drawing function for the node editor.


See Also

  • Bool (Flowgraph Node) - Related reference
  • Color (Flowgraph Node) - Related reference
  • Generic Set/Get Variable (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Transform (Flowgraph Node)

- **Node Name:** `Transform`

Medal / Auto Medal (Flowgraph Node)

- **Node Name:** `Medal`

On this page

OverviewPin SchemaInput PinsOutput PinsHow It WorksInternalsExample UsageAdditional MethodsC:_onDeserialized(nodeData)C:_onSerialize(res)C:drawProperties()See Also