Garry's Mod Wiki

Entity:GetBonePosition

Vector, Angle Entity:GetBonePosition( number boneIndex )

Description

Returns the position and angle of the given attachment, relative to the world.

This function can return entity's GetPos() instead if the entity doesn't have it's bone cache set up.

To ensure the bone position is correct use this:

local pos = ent:GetBonePosition(0) if pos == ent:GetPos() then pos = ent:GetBoneMatrix(0):GetTranslation() end
This can return garbage serverside or Vector(0,0,0) for v49 models.

Issue Tracker: 3285
This can return garbage if a trace passed through the target bone during bone matrix access.

Issue Tracker: 3739

Arguments

1 number boneIndex
The bone index of the bone to get the position of. See Entity:LookupBone.

Returns

1 Vector
The bone's position relative to the world. It can return nothing if the requested bone is out of bounds, or the entity has no model.
2 Angle
The bone's angle relative to the world.

Page Links


Special Pages


Wikis

?

Render Time: 31ms

DB GetPage 2
Generate Html 8
SaveChanges (1) 10
Render Body 0
Render Sidebar 8