Garry's Mod Wiki


number Entity:TranslatePhysBoneToBone( number physNum )


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

See Entity:TranslateBoneToPhysBone for reverse function.


1 number physNum
The PhysObj number on the entity


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


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

Page Links

Special Pages



Render Time: 82ms

DB GetPage 47
Generate Html 10
SaveChanges (1) 10
Render Body 0
Render Sidebar 12