Entity/TranslatePhysBoneToBone

From Garry's Mod
Revision as of 15:36, 6 July 2019 by Code gs (Talk | contribs)
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.

BUG

This does not work on clientside-only entities.

Issue Tracker: #3714

This bug will be fixed in the next update.

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