Entity:GetAttachment
Description
Gets the orientation and position of the attachment by its ID, returns nothing if the attachment does not exist.
The update rate of this function is limited by the setting of ENT.AutomaticFrameAdvance for Scripted Entities!
Arguments
Returns
1 table with AngPos structure or nil
The table with angle and position of the attachment or
nil
if does not exist. See the AngPos structure. Most notably, the table contains the keys Ang
and Pos
as well as Bone
.Example
Grabs the muzzle position of a player's view model.
Example
Draws a green cube at the player's view model muzzle if the model has a "muzzle" attachment. This properly translates the attachment into the view model projection space.