Entity.LookupBone

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:LookupBone( String attachmentName )
Description:
Returns the bone index of the given attachment.
Returns: Integer
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.LookupBone]Entity.LookupBone [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

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