Garry's Mod Wiki

Garry's Mod Wiki

  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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...