Garry's Mod Wiki

Garry's Mod Wiki

  Entity:SetBoneMatrix( number boneid, VMatrix matrix )

Description

Sets the bone matrix of given bone to given matrix. See also Entity:GetBoneMatrix.

Despite existing serverside, it does nothing.

Arguments

1 number boneid
The ID of the bone
2 VMatrix matrix
The matrix to set.

Example

Example usage of the function.

Aim at an NPC and enter "bones_cl" into your console.

if ( CLIENT ) then concommand.Add( "bones_cl", function( ply ) local ent = ply:GetEyeTrace().Entity if ( !IsValid( ent ) ) then return end ent:AddCallback( "BuildBonePositions", function( ent, numbones ) for i = 0, numbones - 1 do local mat = ent:GetBoneMatrix( i ) if ( !mat ) then continue end local scale = mat:GetScale() mat:Scale( Vector( 1, 1, 1 ) * 0.5 ) ent:SetBoneMatrix( i, mat ) end end ) end ) end

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...