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
Accumulator (Flowgraph Node)Ease (Flowgraph Node)Increaser (Flowgraph Node)Expression (Flowgraph Node)
Direction (Flowgraph Node)Look At (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 Extensionsflowgraphnodesmathquaternion

Look At (Flowgraph Node)

- **Node Name:** `Look At`

Overview

  • Node Name: Look At
  • Category: simple
  • File: extensions/flowgraph/nodes/math/quaternion/lookAt.lua

Computes the quaternion rotation needed to look from one position toward another.

Pin Schema

Input Pins

PinTypeDescription
fromvec3The origin of the look-vector
tovec3The target of the look-vector
upvec3Up-vector (default {0,0,1}), hidden/hardcoded

Output Pins

PinTypeDescription
valuequatThe look-at rotation as a quaternion

Internals

FieldPurpose
dirVec (local)Reusable vec3 for the direction vector
dirVecUp (local)Reusable vec3 for the up vector
rot (local)Reusable quat for the result

How It Works

  1. Both from and to must be provided; the node exits early if either is nil.
  2. The direction vector is computed: dirVec = to - from.
  3. The up vector defaults to (0, 0, 1) unless overridden via the up pin.
  4. rot:setFromDir(dirVec, dirVecUp) computes the quaternion that faces along the direction.
  5. The result is output as a table via rot:toTable().

Lua Example

-- Point a camera at a vehicle:
-- from = camera position (vec3)
-- to = vehicle position (vec3)
-- value output = quaternion to set camera rotation

-- Custom up vector for banking:
-- up = {0.1, 0, 0.9} for a slight roll

Key Dependencies

  • vec3, quat - vector/quaternion math primitives
  • setFromDir() - computes rotation from direction + up vectors
  • _flowgraph_createNode() - standard flowgraph node registration

Additional Methods

C:init()

Initializes the node, setting up pins and default properties.

C:work()

Main work function called each frame/tick when the node is active.


See Also

  • Direction (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Direction (Flowgraph Node)

- **Node Name:** `Direction`

Linear Smoother (Flowgraph Node)

- **Node Name:** `Linear Smoother`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsHow It WorksLua ExampleKey DependenciesAdditional MethodsC:init()C:work()See Also