Garry's Mod Wiki

Garry's Mod Wiki

  number Entity:TranslatePhysBoneToBone( number physNum )

Description

Returns the boneID of the bone the given PhysObj is attached to.

See Entity:TranslateBoneToPhysBone for reverse function.

Arguments

1 number physNum
The PhysObj number on the entity

Returns

1 number
The boneID of the bone the PhysObj is attached to.

Example

Does a trace, gets the physics bone from the trace, converts the physics bone number into the bone number and prints the result

concommand.Add( "boneid", function( ply ) local tr = ply:GetEyeTrace() local bone = tr.Entity:TranslatePhysBoneToBone( tr.PhysicsBone ) print( bone ) ply:ChatPrint( bone ) end )
Output: The bone number of what the client is looking at

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