Entity/TranslatePhysBoneToBone

From Garry's Mod
Jump to: navigation, search
 Entity:TranslatePhysBoneToBone( )

Contents

Description

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

See Entity:TranslateBoneToPhysBone for reverse function.

Arguments

number physNum

The PhysObj number on the entity

Returns

number

The boneID of the bone the PhysObj is attached to.

Examples

Example

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

local tr = LocalPlayer():GetEyeTrace()
local bone = tr.Entity:TranslatePhysBoneToBone( tr.PhysicsBone )
print( bone )

Output:

The bone number of what the client is looking at
Personal tools
Navigation