Camera Mode: Observer
Global camera mode that uses scene-placed camera objects to view the action. Supports bullet-time speed control, position blending, and target override for cinematic scenario cameras.
Global camera mode that uses scene-placed camera objects to view the action. Supports bullet-time speed control, position blending, and target override for cinematic scenario cameras.
Overview
The observer camera reads its position/rotation from a named camera object in the scene tree. It can slow down simulation time (simTimeAuthority), blend between positions, and optionally override the look-at target. Used by scenarios for scripted camera sequences.
Class Properties
| Property | Type | Default | Description |
|---|---|---|---|
isGlobal | bool | true | Available regardless of vehicle |
hidden | bool | true | Not in user camera cycle |
cameraName | string | nil | Name of the scene camera object |
camLastBulletSpeed | number | nil | Last applied bullet-time speed |
camT | number | 0.0 | Blend interpolation parameter |
targetOverride | string | nil | Optional target object name |
Methods
| Method | Signature | Description |
|---|---|---|
init | C:init() | Initialize state fields |
update | C:update(data) | Read scene camera, apply pos/rot/fov |
setCustomData | C:setCustomData(customData) | Set camera via {cam, targetOverride} |
setCamera | C:setCamera(cam, targetOverride) | Assign scene camera object and target |
onCameraChanged | C:onCameraChanged(focused) | Notify UI/extensions on focus change |
onScenarioRestarted | C:onScenarioRestarted() | Clear camera on restart |
onScenarioChange | C:onScenarioChange(scenario) | Clear camera when scenario ends |
Bullet-Time Support
-- Scene camera object can have a Speed field for slow-motion
if cam.Speed and tonumber(cam.Speed) then
simTimeAuthority.set(1 / cam.Speed) -- e.g. Speed=4 → 0.25x sim time
if cam.showApps ~= '1' and cam.Speed ~= '1' then
guihooks.trigger('ShowApps', false) -- hide UI during slow-mo
end
endPosition Blending
-- Smooth transition when camera has a PositionMove target
if cam.PositionMove then
local targetPos = vec3():fromString(cam.PositionMove)
camPos = camPos + (targetPos - camPos) * self.camT -- lerp
endTarget Override
-- Override look-at target with a different scene object
if self.targetOverride then
local targetObject = scenetree.findObject(self.targetOverride)
if targetObject then
data.pos = vec3(targetObject:getPosition())
end
endScene Camera Properties
| Field | Type | Description |
|---|---|---|
Speed | string/number | Bullet-time factor (1 = normal) |
blendSpeed | number | Position blend rate (default 50) |
PositionMove | string | Target position for blending |
targetFOV | number | Explicit FOV (default: distance-based) |
showApps | string | '1' to keep UI visible during slow-mo |
Key Notes
- FOV defaults to
90 - distance * 3iftargetFOVnot set (min 10) - Resets bullet-time to
1xwhen camera is cleared - Fires
onCameraModeChanged('observer')hook when focused
See Also
- Camera Mode: Autopoint - Related reference
- Camera Mode: Autozoom - Related reference
- Camera Mode: Big Map - Related reference
- Core Systems Guide - Guide
Camera Mode: Noise
Simple random noise filter that adds small positional jitter to the camera. Creates a subtle handheld or vibration effect.
Camera Mode: Onboard
Vehicle-mounted camera that follows a specific node position with configurable rotation and offset. Used for cockpit, hood, bumper, and other vehicle-attached views.