Handling left hand for dynamic two-handed melee animations

Hey everyone, I currently have a first person melee system similar to Mordhau where you can choose within 240 degrees for your strike’s angle, allowing for horizontal, overhead, and unterhau strikes.

Demonstration of polearm issue + 1h functioning properly

Right now, I am just using store bought assets for prototype/building MVP purposes. These came with a UE4 Manny skeleton with right hand sockets to use for attaching the weapon. i.e. weapons are attached to the right hand.

This works beautifully for one-handed weapons since I can just use a Control Rig to modify clavicle_r and upperarm_r to rotate and match the player’s input strike angle (with base + offset values based around a completely horizontal strike angle). For parries, I edited the base pose into left, topleft, top, topright, and right poses and use two blendspaces (left/right or supinated/pronated hand) to match in-between angles for a full 180-degree parrying aesthetic.

Things get much trickier with two-handed weapons. Simply rotating the same amount as clavicle_r and upperarm_ for the left counterparts won’t work once a strike angle is sufficiently high enough because it results in swimming/no longer “gripping” the weapon.

The closest I’ve gotten is to use either a Two Bone IK or FABRIK node being fed the Transform return of my “LeftHandIKTransform” BPI. This “LetHandIKTransform” consists of Get Socket Transform using ‘left hand grip’ socket in the weapon mesh, returning its location value into Transform to Bone Space with the player’s mesh as the target and hand_r as the bone name, and returning that location as the transform to feed into the Two Bone IK or FABRIK node.

In my attempts with Two Bone IK, I set the IKBone to hand_l, Effector Target to hand_r (Bone Space), and joint target to hand_l (Parent Bone Space).

In my attempts with FABRIK, I set Effector Target to hand_r, tip bone to hand_l, root bone to upperarm_l.

Both seem to return identical results. The Main Problem: They’re almost perfect solutions, except that because they are targeting hand_l itself, the shaft of the polearm ends up going through the wrist. I’ve tried adding an offset and also tried making a new bone hovering in front of the left palm to match onto the weapon’s ‘left hand grip socket’ for the “LeftHandIKTransform” BPI, but these at best look good for some angles and start to swim/break offset and hover at more extreme angles.

This cryptic nine-year old video seems to have exactly what I want: https://www.youtube.com/watch?v=SfEaRBstY80

EDIT: I swapped out the Two Bone IK’s Effector Target from hand_r to VB Hand_R_Hand_L and enabled Take Rotation from Effector Space. Setting a manual offset to the “LeftHandIKTransform” to serve as the ‘palm’ in lieu of the hand_l wrist now works!

Leaving this topic up because it would still be neat to know how that old video achieves its effect with what seems to be the weapon mesh NOT attaching to a socket on the right hand.

I think that using Control Rig will give you more flexibility and allows you to control and add constraints the left hand so that it’ll behave in a specific way based on right arm orientation/position.

I made this tutorial a while ago to which is more focus on runtime two handed grip which may help you do a setup for you left arm.

The nice thing about the setup is that the wrist rotation isn’t locked on all axis, but Yaw axis is based on the runtime data.

Regarding the left hand general behaviour I suggest you to do one thing for the “swimming/detached” left hand, which in short is the forward translation of the clavicle_l joint based on the arm length at runtime ( using Control Rig ), so that every time the left arm is about to be fully extended, the clavicle will be pushed forward to compensate that distance.
Is a trick often used in FPS games during melee/reloading to make sure that the left arm isn’t always struggling to reach the weapon sockert position.

If you need additional help with the setup feel free to reach out :slight_smile:

1 Like

(post deleted by author)

Thanks a ton for the reply!

Your implementation is way more robust and I’m trying to follow along.

I created a new CtrlRig for this LH matching, independent from the dynamic strike angle.

I’ve followed the nodes and values nearly 1:1 to what’s provided in the video you linked + the project (though it seems a bit bugged when I try to open it with my UE 5.7 editor, probably due to version differences and missing plugins).

I did change a couple things though:

  • Under the “Vector length between ik_hand_l and ik_hand_r + Remap” portion, I’ve changed the Remap node’s Target Minimum to 0.0 and Target Maximum to 1.0 whereas in the video and project, it was set to 1.0 and 0.0 respectively. On my end, this visually changed from the left hand floating in space into snapping to the proper hand_r_ctrl_left_offset position on the weapon.

  • I changed hand_r_ctrl_left_offset’s OffsetRotatorRoll (in Local Space) from 0 to 180 degrees. This visually changed the left hand from being bent awkwardly to now having the correct grip direction.

Almost everything seems to be perfect. The left hand follows the right hand and thus the weapon’s shaft properly even in animations meant for other things like one-handed parry.

Problem: However, I can’t figure out how to manage a proper offset so that it’s attaching to the character’s grip/palm rather than the wrist (hand_l). I’ve naively attempted modifying offset such as adding to the Get Transform - Control (hand_l_control) before feeding it into the Basic IK’s Translation. But it ultimately is still pivoting around Basic IKEffector ItemType: Bone, Name: hand_l aka the wrist.

Edit: Also noticed the shoulder is dislocated

On the plus side, I now see that I can easily feed a float value for the distance between right and left hand on the grip, this will be a way better method to use than finding out and manually entering offset values for every weapon in the future!