TraceRes.PhysicsBone completely incorrect?

I’m trying to retrieve what ragdoll bone a player selected, but tracelines appear to return incorrect bone indices from my tests (using GetEyeTrace). If I aim for the left hand for example, which should be index 16 (found using LookupBone(“ValveBiped.Bip01_L_Hand”)), instead it returns the index 5 (which corresponds to LookupBone(“ValveBiped.Bip01_Neck1”), that bone doesn’t even have a hitbox!).

Bug or am I overlooking something?

A physics bone isn’t the same as a regular bone at all. Use ENT:TranslatePhysBoneToBone() if you need to convert a physics bone into a regular bone.

Thank you. So I did overlook something :slight_smile:

[editline]12:19PM[/editline]

Yup, works perfectly.

To clarify here, the “physics bone” is the “n” used with Entity:GetPhysicsObjectNum(n).

It’s stuff like this that makes developing for GMod frustrating.