self:look_at_from_position

Client

Moves the vehicle body to a position and rotates it so its -Z axis points toward the given target


Syntax

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

Parameters

TypeNameDescription
vector3positionWorld-space position to move to 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 and point a vehicle body
local entity = physics.vehicle.create()

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

On this page