SetParentPhysNum() not working?

What am I trying to do?
I’m trying to parent props to certain parts of a ragdoll.
Getting the correct bone number works.
The only thing that doesn’t work correct is the parenting.

It works like this.
With a stool you pick one prop and one ragdoll.
When that is done the prop should be parented to the bone that was closest to the trace hitpos (when choosing the ragdoll).

I have tried all types of combinations, i even tried putting a delay on the SetParentPhysNum() since a similar function I found in the valve dev requires that.

This doesn’t work.
[lua] if self.Ragdoll != NULL && self.Object != NULL then
self.Object:SetParent(self.Ragdoll)
self.Object:SetParentPhysNum(self.BoneNum)
end[/lua]

Neither do this
[lua] if self.Ragdoll != NULL && self.Object != NULL then
self.Object:SetParentPhysNum(self.BoneNum)
self.Object:SetParent(self.Ragdoll)
end[/lua]

or this.
[lua] if self.Ragdoll != NULL && self.Object != NULL then
self.Object:SetParentPhysNum(self.BoneNum)
self.Object:SetParent(self.Ragdoll:GetPhysicsObjectNum(self.BoneNum))
end[/lua]

I don’t get any errors.
I’m starting to think that SetParentPhysNum() is broken since GetParentPhysNum() always returns nil even after it’s set.
The props also always gets parented to bone number 0 (pelvis default bone).

I checked the nail stool which uses SetParentPhysNum() and it seems to have the same problem.
The nail gets parented to the pelvis.
Then the maybe the function really is broken. :colbert: