Model

self:get_component_global_position

Shared

Retrieves the global position of a component on the model

Syntax

local position = self:get_component_global_position(
    component
)

Parameters

TypeNameDescription
stringcomponentPath of the component to query

Returns

TypeNameDescription
vector3positionCurrent global position of the component as {x, y, z}

Examples

Get the global position of a component
core.model.load("character", "models/character.glb")

local entity = core.model.create("character")
local position = entity:get_component_global_position("Skeleton3D/Hat")

core.engine.print("info", "Component position:", util.table.unpack(position))

On this page