Hey there,
I wanted to track interaction of two skeletal mesh components (both kinematic, but with a physics asset, collision channels set to overlap, multi-body overlap flag etc.). I’d like to get rather hit events, but it’s obiously impossible in kinematic mode. So I wanted overlapping. And I got it. But the way it works makes me stuck with questions.
So each event we have OverlappedComponent, OverlappedActor (redundant since the former), OtherComponent and OtherBodyIndex. (And a HitResult which is empty by design, so no reason to mention it).
Why on earth, why only the Other Body Index?! I want to know first which of my bones/bodies gets affected by the nearby object, whatever the latter is. Instead I have to check and switch to the OtherComponent and make it feel hurt internally in its OtherBodyIndex location.
Okay, but I still need two meshes feel equally hurt in the respective bodies. People usually advice trace functions, but I lack even a direction to trace to. I’m using a stupid loop through Mesh1.Bodies
looking for the closest to OtherMesh.Bodies[OtherBodyIndex].GetCOMPosition()
but it makes me feel I’m missing something.
I tried to sniff overlap events sequence, but there is a mess, e.g. right after Mesh1 gets an ovelap begin form Mesh2(Body2), Mesh2 gets an overlap begin from Mesh1 with OtherBodyIndex == -1. Such incomplete events are usually bound to the same pawn, while the other receives full data, though these pawns are indentical clear objects of the same class. Seems like one body index always disappears in a weird Heisenbergish algorhithm, but I can’t imagine how the engine could ignore one body when detecting overlap of the two.
All in all, are there sane workarounds extracting at least both body indices if a complete HitResult is impossible in this process?