Entity/TranslatePhysBoneToBone

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Bug)
(Fixed)
Line 4: Line 4:
 
See {{ClassFunction|Entity|TranslateBoneToPhysBone}} for reverse function.
 
See {{ClassFunction|Entity|TranslateBoneToPhysBone}} for reverse function.
  
{{Bug|Issue=3714|This does not work on clientside-only entities.}}
+
{{Bug|Issue=3714|Fixed=|This does not work on clientside-only entities.}}
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes

Revision as of 15:36, 6 July 2019

 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