self:look_at_from_position

Client

Moves the camera to the given position and rotates it to look at the target


Syntax

local status = self:look_at_from_position(
    position,
    target,
    up
)

Parameters

TypeNameDescription
vector3positionWorld-space position to place the camera at as {x, y, z}
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

Position a camera and aim it at a target
local entity = core.camera.create()

entity:look_at_from_position({0, 10, 10}, {0, 0, 0}, {0, 1, 0})
entity:set_active()

On this page