Skip to content

Camera

Overview

The Camera table provides access to a game world's active camera.

Functions

IsAvailable

function Camera.IsAvailable() -> Boolean

Returns whether camera information is currently available.

Returns Description
Boolean Whether camera information is available to read from.

Example

if Camera.IsAvailable() then
    local cameraPos = Camera.GetPosition()
    ...
end

GetPosition

function Camera.GetPosition() -> Vector3

Returns the current position of the game world's camera.

The return value will be {0, 0, 0} if the camera is unavailable.

Returns Description
Vector3 The position of the camera, in fine units.

Example

if Camera.IsAvailable() then
    local cameraPos = Camera.GetPosition()
    ...
end

GetFocusPosition

function Camera.GetFocusPosition() -> Vector3

Returns the current focus position of the game world's camera.
This is typically the waist position of the Player Character during normal gameplay.

The return value will be {0, 0, 0} if the camera is unavailable.

Returns Description
Vector3 The focus position of the camera, in fine units.

Example

if Camera.IsAvailable() then
    local cameraFocusPos = Camera.GetFocusPosition()
    ...
end