Entity.GetAttachment

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetAttachment( Integer attachmentID )
Description:
Returns the angle and position of an attachment point on a model.
Returns: Table :Angpos
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetAttachment]Entity.GetAttachment [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionFind where the Jeep's gun is and where it's pointing.
Used onNewerServer.png
Code
function getJeepGunPosAng(Jeep)
    local attachmentID=Jeep:LookupAttachment("gun_ref");
    return Jeep:GetAttachment(attachmentID)
end
OutputThis function returns a table with the angles and position in the Angpos format.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox