self:get_bone_position
Shared
Retrieves the current position of a skeleton bone in 3D world-space
Syntax
local position = self:get_bone_position(
bone
)Parameters
| Type | Name | Description |
|---|---|---|
string | bone | Name of the bone to retrieve the position of |
Returns
| Type | Name | Description |
|---|---|---|
vector3 | position | 3D world-space position of the bone as {x, y, z} |
Examples
local entity = core.model.create("character")
local position = entity:get_bone_position("Head")
core.engine.print("info", "Bone position:", util.table.unpack(position))local entity = core.model.create("character")
local bone = "Head"
util.event.on("sandbox:draw", function()
local position = entity:get_bone_position(bone)
local screen, distance = core.engine.world_to_screen(position)
if screen[1] == -1 then return false end
core.engine.draw_circle(screen, 5, {1, 0, 0, 1})
end)