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
| Type | Name | Description |
|---|---|---|
vector3 | global_point | World-space position to convert as {x, y, z} |
Returns
| Type | Name | Description |
|---|---|---|
vector3 | local_point | Resulting local-space position as {x, y, z} |
Examples
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))