API ReferenceGE Extensionsflowgraphnodesscenecamera
Camera Auto Circle (Flowgraph Node)
- **Node Name:** `Camera Auto Circle`
Overview
- Node Name:
Camera Auto Circle - Category:
once_p_duration - File:
extensions/flowgraph/nodes/scene/camera/cameraCircle.lua - Icon: Camera icon
- Color: Camera color
Makes the camera orbit in a circle around a vehicle or point. Supports configurable radius, height, speed, and optional terrain-snapping height.
Pin Schema
Input Pins
| Pin | Type | Hidden | Description |
|---|---|---|---|
vehId | number | no | Vehicle ID to orbit; defaults to player vehicle |
centerPos | vec3 | yes | Override center position (instead of vehicle) |
startAngle | number | yes | Starting angle in degrees |
radius | number | no | Distance from center point |
height | number | no | Height above center point |
snapHeight | bool | yes | If true, height is relative to terrain surface |
speed | number | no | Rotation speed (deg/sec); negative = counterclockwise |
Output Pins
None.
Internals
self.angle- current orbit angle in degrees, incremented bydtReal * speedeach frame.self.centerPos,self.offset,self.camPos- reusable vec3 objects to avoid allocation.- On
workOnce, if a vehicle is targeted, the start angle is made relative to the vehicle's forward direction. - When
snapHeightis active, usesbe:getSurfaceHeightBelow()and lerps between frames for smooth transitions.
How It Works
- Setup (
workOnce) - Switches to free camera, adjusts start angle relative to vehicle facing direction (if applicable). - Each frame (
work):- Updates the center position from the vehicle's OOBB center or the
centerPosoverride. - Computes camera position on the circle:
center + (sin(angle), cos(angle), 0) * radius + height. - If
snapHeight, adjusts Z to terrain height (with smoothing), clamped to prevent going below center. - Points the camera at the center using
quatFromDir. - Increments angle by
dtReal * speed.
- Updates the center position from the vehicle's OOBB center or the
Lua Code Example
-- Cinematic orbit around the player vehicle:
-- cameraCircle (radius=10, height=3, speed=15)
-- Camera slowly orbits at 10m distance, 3m up, 15°/sec clockwise.
-- Orbit around a fixed point:
-- cameraCircle (centerPos={100,200,50}, radius=20, height=5, speed=-10)
-- Counterclockwise orbit around world position.Key Dependencies
core_camera-setPosRot()commands.isFreeCamera()/commands.setFreeCamera()be:getSurfaceHeightBelow()- terrain height querygetObjectByID()- vehicle lookupself.mgr.dtReal- real-time delta
Additional Methods
C:_executionStarted()
Called when graph execution starts. Used for initialization/reset.
C:onNodeReset()
Called when the node is reset.
See Also
- Camera Transform (Flowgraph Node) - Related reference
- Camera Look at Position (Flowgraph Node) - Related reference
- Simple Cam Path (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide