Garry's Mod Wiki

Revision Difference

Entity:TranslatePhysBoneToBone#514569

<function name="TranslatePhysBoneToBone" parent="Entity" type="classfunc">⤶ <description>⤶ Returns the boneID of the bone the given <page>PhysObj</page> is attached to.⤶ ⤶ See <page>Entity:TranslateBoneToPhysBone</page> for reverse function.⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="physNum" type="number">The &lt;page&gt;PhysObj&lt;/page&gt; number on the entity</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="number">The boneID of the bone the <page>PhysObj</page> is attached to.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Does a trace, gets the physics bone from the trace, converts the physics bone number into the bone number and prints the result</description>⤶ <code>⤶ local tr = LocalPlayer():GetEyeTrace()⤶ local bone = tr.Entity:TranslatePhysBoneToBone( tr.PhysicsBone )⤶ print( bone )⤶ </code>⤶ <output>The bone number of what the client is looking at</output>⤶ ⤶ </example>