Model

self:get_component_position

Shared

Retrieves the local position of a component on the model

Syntax

local position = self:get_component_position(
    component
)

Parameters

TypeNameDescription
stringcomponentPath of the component to query

Returns

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

Examples

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

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

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

On this page