Garry's Mod Wiki

Entity:SetBonePosition

  Entity:SetBonePosition( number bone, Vector pos, Angle ang )

Description

Sets the bone position and angles.

For changes to happen, this must be called in a rendering hook.

Arguments

1 number bone
The bone ID to manipulate
2 Vector pos
The position to set
3 Angle ang
The angles to set

Example

Sets the head of every player above their character

hook.Add("PrePlayerDraw", "HeadsUp", function(ply, flags) local bone = ply:LookupBone( "ValveBiped.Bip01_Head1" ) if not bone then return end local angle = ply:EyeAngles() + Angle(-90,0,90) local position = ply:LocalToWorld( Vector(0,0,100) ) ply:SetBonePosition( bone, position , angle ) end)
Output:
SetBonePosExample.jpg