LineTrace for SkeletalMeshComponents with MasterPose

Lord7even
Sun, 10 Dec 2017 19:38:52 +0000
World Creation

Hi there

Well, let’s try to make it short. I’m working on a dismembering solution for individual body parts of a character.
I guess the main problem is that the function “SetMasterPoseComponent” sets the PhysicsAsset and BoneMap from the target component to the master component.

i.e.: I can’t get a hit result of my arm or leg component if I do a LineTrace. The hit component is always the one who’s the MasterPose (the torso) instead of the, on runtime attached, SkeletalMeshComponent.

In a not so technical sentence: If my gun hits an arm or leg, it says that I hit just the torso which is the MasterPoseComponent of arm and legs. If I print out the hit Bone-Name it displays Spine_02 instead of the arms bone name which would be “LeftArm, LeftHand or LeftUperArm”.

Here is my setup:

Inherited Mesh (from Character Actor) is only the torso with its own Physics Asset

Added additional SkeletalMeshComponents, also with their own Physics Assets

Set MasterPoseComponent to Inherited Mesh for all additional SkeletalMeshComponents

Here are some ideas for a solution:

Don’t use MasterPose. But then I’ve to call animation stuff for each body part, not just the main one. (Not sure, if this will be accurate or ends up with async animations.)

Change the function “SetMasterPoseComponent” in the engine that the Physics State doesn’t get updated. (No clue if this even works and it would be a bit overkill.)

Set the Physics Asset of the main mesh (Torso) to one that has physics for the whole body, including arms and legs. But then, the arms collide even if the arm-mesh is dismembered from the body.

Setup individual meshes for every possible dismembering state. I.e. One with no left arm, one with no right arm, one with no left and right arm and so on, which would end in a lot of work

Any hint or idea of a solution would be really helpfull, since I’ve no idea which way to go from here. Thank you very much.

Best regards - Lord7even

Some screenshots:

Body parts:

Character setup:

Blueprint:

1 post - 1 participant