Skip to content

Exports (client)#

StartOrbitCam#

Starts the orbit camera.

Parameters:
position - vector3 - Initial position to focus on.
entity - integer? - Entity to track. If set, position will be the offset to the entity.
minRadius - float? - Minimum radius the camera will orbit at.
maxRadius - float? - Maximum radius the camera will orbit at.
transitionSpeed - float? - Time it takes for the transition from gameplay cam to orbit cam (in ms).
entityBone - integer? - Bone to track. If set, position will be the offset to the bone.

local offset = vector3(0, 0, 0.5)
local entity = PlayerPedId()
exports["OrbitCam"]:StartOrbitCam(offset, entity)

EndOrbitCam()#

Stops the orbit camera.

exports["OrbitCam"]:EndOrbitCam()

UpdateCamPosition#

Sets the camera focus to a different position (or updates other values).

Parameters:
position - vector3 - Position to focus on.
entity - integer? - Entity to track. If set, position will be the offset to the entity.
minRadius - float? - Minimum radius the camera will orbit at.
maxRadius - float? - Maximum radius the camera will orbit at.
entityBone - integer? - Bone to track. If set, position will be the offset to the bone.

local newOffset = vector3(0.5, 0.5, 1.0)
local entity = PlayerPedId()
exports["OrbitCam"]:UpdateCamPosition(newOffset, entity)

SetAutoOrbitSpeed#

Sets the camera focus to a different position (or updates other values).

Parameters:
speed - float? - Speed at which the camera should orbit. Set to nil to reset.
disablePlayerControls - boolean? - If player controls should be disabled.

exports["OrbitCam"]:SetAutoOrbitSpeed(2.0, true)

IsOrbitCamActive()#

Check if the orbit cam is currently active.

Returns:
bool - True if the camera is currently active.

local isCamActive = exports["OrbitCam"]:IsOrbitCamActive()

IsEntityBeingTracked(entity)#

Checks if an entity is being tracked. Omitting entity parameter checks for any entity.

Parameters:
entity - integer? - Entity to check.

Returns:
bool - If the/any entity is being tracked.

local isTrackingPlayer = exports["OrbitCam"]:IsEntityBeingTracked(PlayerPedId())

GetTrackedEntity()#

Returns the currently tracked entity.

Returns:
integer? - The handle of the tracked entity or nil if there is none.

local trackedEntity = exports["OrbitCam"]:GetTrackedEntity()