Trouble getting relative transform of a socket for IK

I have an IK setup to move the character’s left hand to the barrel of a weapon, and right now I’m passing in the weapon socket’s world transform that’s being updated every frame. The character’s hand lags behind the actual transform position however, so instead of using the world transform I wanted to get the transform of the socket relative to the weapon root so that I don’t have to worry about a delay when the joint chain tracks it. I haven’t been able to figure out how to get the relative transform though, every attempt just results in the character’s arm being extended in some horrific angle.

Here’s my current logic:


Thanks.

Effector Transform Space is set to Bone Space & Effector Transform Bone is None.
You’re telling hand_l to match the location of another bone, which is not specified.

Instead of trying to calculate the left hands position each tick, figure out the offset required from the right hand when you first attach the weapon mesh.
You should be able to feed that into the IK node with the Effector Transform Space is set to Bone Space & Effector Transform Bone set to your right hand.

It tracks flawlessly now, thank you very much. I didn’t understand what the effector transform bone was for, thank you for the clarification.

@Kris, great idea. Thanks!
Though, I’m not sure it will work in case of 2D aim offset.

3d/2d - shouldn’t matter.