self:look_at

Client

Rotates the camera so its -Z axis points toward the given world-space target


Syntax

local status = self:look_at(
    target,
    up
)

Parameters

TypeNameDescription
vector3targetWorld-space position to look at as {x, y, z}
vector3upUp vector used to determine orientation as {x, y, z}

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Point a camera at the world origin
local entity = core.camera.create()
entity:set_position({0, 5, 10})

entity:look_at({0, 0, 0}, {0, 1, 0})

On this page