Entity.GetBonePosition

From GMod Wiki

Revision as of 00:41, 4 November 2011 by Albert (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax Entity:GetBonePosition( Integer boneindex )
Description:
Returns the position and angle of the given attachment, relative to the world.
Returns: Vector Position, Angle Angle
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetBonePosition]Entity.GetBonePosition [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionOutput the world position and angle of your head to console
Used onNewerShared.png
Code
local function BoneTest( ply, cmd, arg )
    local BoneIndx = ply:LookupBone("ValveBiped.Bip01_Head1")
    local BonePos , BoneAng = ply:GetBonePosition( BoneIndx )
    ply:PrintMessage( HUD_PRINTCONSOLE , "HeadPos = ".. tostring(BonePos) .."HeadAng = ".. tostring(BoneAng) )
end
 
concommand.Add( "BoneTest", BoneTest )
 
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox