Hey, thank you for your comments!
Yes, the weapon sway (due to mouse movements and strafing left and right) is handled in the UpdateGraph → DirectionalSway. From there the resulting rotations and locations are used in the Anim Graph to feed TransformBone nodes, which move the IK target for the gun hand.
When not aiming, it’s pretty straight forward - it just rotates the IK target and the only time it’s translated is when you’re firing and it moves backwards.
Now, when aiming it’s when it gets tricky, because I decided I should rotate it about the sight’s point, instead of letting the hand bone rotate about itself. This makes sure the sight’s point never leaves the center of the screen when the gun is rotating. So inside the DirectionalSway, in the aiming section only, you’ll find a bit of math that does that. This is ‘married’ to the CalcHandTransforms function in the gun BP, so in order for it to work properly it needs to remain married.
Another important part of this IK setup is the use of virtual bones as targets for the hands’ IKs. Unreal’s virtual bones snap to their non-virtual counterparts by default, so I have one for the right hand and another one for the left hand, this way I know they’re following the hands animations. But, in the Anim Graph, I have the chance of moving them in the direction I want depending on the situation.