self:to_local

Client

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


Syntax

local local_point = self:to_local(
    global_point
)

Parameters

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

Returns

TypeNameDescription
vector3local_pointResulting local-space position as {x, y, z}

Examples

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

local local_point = entity:to_local({0, 0, 0})
core.engine.print("info", "Local point:", util.table.unpack(local_point))

On this page