Model
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 = model.create("character")
local position = entity:get_bone_position("Head")
engine.print("info", "Bone position:", position[1], position[2], position[3])local entity = model.create("character")
local bone = "Head"
network:fetch("vital.sandbox:draw", true):on(function()
local position = entity:get_bone_position(bone)
local screen, distance = engine.world_to_screen(position)
if screen[1] ~= -1 then
engine.draw_circle(screen, 5, {1, 0, 0, 1})
end
end)