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
Collection Marker (Flowgraph Node)Custom Lua Command (Flowgraph Node)Get Object Field (Flowgraph Node)Get Player Vehicle ID (Flowgraph Node)Get Point on Decalroad (Flowgraph Node)Show/Hide Object (Flowgraph Node)ID by Name (Flowgraph Node)Keep Prefab (Flowgraph Node)Particle Emitter (Flowgraph Node)Point on Decalroad (Flowgraph Node)Raceline Parking (Flowgraph Node)Raycast (Flowgraph Node)Parking Markers / Rect Marker (Flowgraph Node)Reload Collision (Flowgraph Node)Reload Nav Graph (Flowgraph Node)Remove Prefab (Flowgraph Node)Reset Prefab (Flowgraph Node)Set Object Field (Flowgraph Node)Sevensegment Display (Flowgraph Node)Single Marker (Flowgraph Node)Spawn Light / SpotLight (Flowgraph Node)Spawn Prefab (Flowgraph Node)Spawn TSStatic (Flowgraph Node)Store Statics (Flowgraph Node)Track Prefab (Flowgraph Node)
Camera Transform (Flowgraph Node)Camera Look at Position (Flowgraph Node)Camera Auto Circle (Flowgraph Node)Simple Cam Path (Flowgraph Node)Get Camera FOV (Flowgraph Node)Get Camera Mode (Flowgraph Node)Get Cam Path (Flowgraph Node)Restart Cam Path (Flowgraph Node)Return Camera to Vehicle (Flowgraph Node)Set Camera FOV (Flowgraph Node)Set Camera Mode (Flowgraph Node)Set Camera Position (Flowgraph Node)Set Camera Rotation (Flowgraph Node)Start Cam Path (Flowgraph Node)Stop Cam Path (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 Extensionsflowgraphnodesscenecamera

Set Camera Rotation (Flowgraph Node)

- **Node Name:** `Set Camera Rotation`

Overview

  • Node Name: Set Camera Rotation
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/scene/camera/setCameraRotation.lua

Sets the free camera's rotation using a quaternion. Supports two modes: a hardcoded custom rotation or a dynamic rotation from an input pin. Preserves current camera position.

Pin Schema

Output Pins

PinTypeDescription
valuequatThe rotation that was set

Dynamic Input Pins (mode-dependent)

PinTypeDescription
rotquatRotation from pin (only in "from Pin" mode)

Behavior

  • work() - Each frame:
    1. Switches to free camera if needed.
    2. Reads rotation from input pin (if "from Pin" mode) or uses stored custom rotation.
    3. Calls SetCamera() which uses core_camera.setPosRot() with current position and the new rotation.
    4. Outputs the applied quaternion.
  • drawCustomProperties() - Editor UI with:
    • Mode dropdown: custom or from Pin
    • Rotation drag fields (4 floats for quaternion, in custom mode)
    • "Set from camera" button to capture current camera rotation
    • "Preview" button to apply the rotation
  • Serialization - Saves/restores rotation and mode. Normalizes the quaternion on set.

Internals

  • self.rotation - quat storing the target rotation
  • self.mode - 'custom' or 'from Pin'
  • SetCamera() - Applies rotation while preserving position via core_camera.getPosition()

Key Dependencies

  • commands.isFreeCamera() / commands.setFreeCamera() - Free camera management
  • core_camera.setPosRot(player, x, y, z, qx, qy, qz, qw) - Sets camera transform
  • core_camera.getPosition() - Gets current camera position
  • core_camera.getQuat() - Gets current camera rotation (for editor capture)

How It Works

Mirror of Set Camera Position but for rotation. In custom mode, the quaternion is editable in the node editor. In from Pin mode, a dynamic input pin accepts quaternion data from other nodes. The rotation is normalized when set via the editor. Position is always preserved when updating rotation.

Example Usage

-- Static look direction: use custom mode, capture rotation from editor
-- Dynamic rotation: use from Pin mode, wire a quat from interpolation nodes
-- Combine with Set Camera Position for complete camera transform control

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:drawMiddle(builder, style)

Custom ImGui drawing in the middle section of the node in the editor.

Parameters:

  • builder
  • style

C:init()

Initializes the node, setting up pins and default properties.


See Also

  • Camera Transform (Flowgraph Node) - Related reference
  • Camera Look at Position (Flowgraph Node) - Related reference
  • Camera Auto Circle (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Set Camera Position (Flowgraph Node)

- **Node Name:** `Set Camera Position`

Start Cam Path (Flowgraph Node)

- **Node Name:** `Start Cam Path`

On this page

OverviewPin SchemaOutput PinsDynamic Input Pins (mode-dependent)BehaviorInternalsKey DependenciesHow It WorksExample UsageAdditional MethodsC:_onDeserialized(nodeData)C:_onSerialize(res)C:drawMiddle(builder, style)C:init()See Also