self:to_global

Client

Converts a local-space position to a global world-space position


Syntax

local global_point = self:to_global(
    local_point
)

Parameters

TypeNameDescription
vector3local_pointLocal-space position to convert as {x, y, z}

Returns

TypeNameDescription
vector3global_pointResulting world-space position as {x, y, z}

Examples

Convert a local point to world space
local entity = core.camera.create()
entity:set_position({0, 5, 0})

local world_point = entity:to_global({1, 0, 0})
core.engine.print("info", "World point:", util.table.unpack(world_point))

On this page