Garry's Mod Wiki

Entity:ManipulateBoneScale

  Entity:ManipulateBoneScale( number boneID, Vector scale )

Description

Sets custom bone scale.

This does not scale procedural bones.

Issue Tracker: 3502
This silently fails when given a Vector with nan values, hiding the vertices associated with the bone. See example below.

Arguments

1 number boneID
Index of the bone you want to manipulate
2 Vector scale
Scale vector to apply. Note that the scale is relative to the original bone scale, not relative to the world or the entity.

Example

Shows the difference between nan and zeroing scale.

-- Scales the head bone down, essentially pinching the vertices concommand.Add( "scale_player_head", function( ply, cmd, args ) local ply = Entity(1) local bone = ply:LookupBone("ValveBiped.Bip01_Head1") if not bone then return end ply:ManipulateBoneScale( bone, Vector(0,0,0) ) end ) -- Hides the part of the mesh that follows the head bone concommand.Add( "hide_player_head", function( ply, cmd, args ) local ply = Entity(1) local bone = ply:LookupBone("ValveBiped.Bip01_Head1") local nan = 0/0 if not bone then return end ply:ManipulateBoneScale( bone, Vector(nan,nan,nan) ) end )