"OnConstraintBroken" - How to Determine what Bone is affected?

I’m working with Ragdolls and have a setup where I can hit the mannequin and have it’s limbs come off based on physics (“linear breakable” set in the Physics Asset).

Problem - I can’t figure out how to determine which bones have been affected when a constraint has been broken (e.g. to add a bloodsplatter particle effect at that point, or to immobilize the pawn when it has no legs, etc.)?

I have a custom event bound to “OnConstraintBroken”, which fires correctly, but the event’s parameter “constraint index” always returns 0. Is this a bug or does it refer to the whole PhysAsset (0 as I only have one) and not the constraints therein?

I could check which bone has been directly hit in general, but that is not the same, as an impact could break off limbs that were not hit directly at all, and that wouldn’t tell me where the break occurred anyways (e.g. when hitting the lower arm, it could break at the hand or the elbow I suppose).

Is there a way to get the bone names of broken constraints or are there other events I should use instead?
Any suggestions how to tackle this, would be much appreciated.

im also interested about this :slight_smile:

I’m not using a skeletal mesh but the only way I was able to know which constraint has broken was to tie a different custom event to each constraint’s OnConstraintBroken at runtime.

As far as skeletal meshes, I checked the engine source and it looks like that index value should be set when you get the event. It gets set, passed into PhysX with ‘user-defined’ data, and then gets passed back for the event call. I’m looking at 4.14 so if you’re not doing anything wrong then maybe you should upgrade your project and see if it works now.

Jin_VE : Yes! Tested it with 4.14, works as intended now.

Thanks for reminding me of the issue, I would probably never have come back to that otherwise. Much appreciated.