Need help understanding IK.

I don’t really understand how IK works. And I haven’t really found any good tutorials that actually explain what all the bits do and why they are there.

I’ve got the default HeroTPP skeleton and I want to move my two hands down a bit to hit a surface while climbing instead of just floating above it.

Now I know I need the position where I want my hands to end up in, so I’m doing a trace down from the position of the hands.
Then I feed that location into my animation blueprint and that’s where I don’t really know what I’m doing any more.

I’m converting the local to component space and back again like the documentation says I should, which does something and is useful, but I’m not sure what.

Then there’s the “Two Bone IK” node:

I have to set a IK bone, which I assume I want to set as the “hand_r” or “hand_l” bone.
It takes in a “Effector Location”, which I assume is the location I want stuff to end up in.
Then a “Joint Target Location”, which I know nothing about.

What is the “Joint Target Location”?
What are the location vectors relative to? (Actor? Bone? IK Root? World?)
Why do I see in tutorials a vector with only an X value as the effector location that’s supposed to determine world Z axis for the end location of the (foot)bone?

Are the IK bones always supposed to move along with the actual bones they’re representing?
Do the two bone IK manipulations always just take the next 2 bones and manipulate those, or are those set somewhere separately (like in 3dsmax/maya)?

You can define the space for IK in the node’s Details pane; if you’re using traces to do it, you want world space.

The “joint target” is the location of the elbow or knee; if a leg has to bend to solve the IK, you need to define where the knee is (where to solve the joint TOWARD) or it’s liable to bend the legs backward like a chicken (or sideways, or whatever) when moving the bones. You can usually get this value from your skeleton if it has IK control bones in the legs, as you’ll already have a “knee pit” type bone which will be defined for the base pose, and solving toward IT will work most of the time (unless the player rotates his feet a lot on account of the IK, in which case you’ll need to take the foot transforms and define a new vector forward from the toes and up to about knee height, so that the knees always point toward the toes which is generally how legs work).

Note that sometimes when using IK rigs, IK bones AREN’T skinned bones, they’re just control bones, to which the actual bones are parented in the 3D modeling software (particularly true if the rig you’re using was designed to support both IK AND FK keyframing). If you want to use UE’s IK, you’ll either need to apply the IK directly to the normal bones, OR (again, it depends on your rig, mine is derived from the MHX rig and is built with an odd hierarchy due to the IK/FK control setup) apply them to the IK control chain and then use a string of “Copy Bone” nodes to “skin” the actual vertex-weighted bones to the positions defined by the IK bones with the solver applied to them.

Alright, got my IK working now.
Had a bit of trouble with the joint target location, because I forgot it was just relative to the actor, unlike the effector world location. With the HeroTPP skeleton I had to apply the node to the actual skinned hand bones. I’m still not sure what they actual IK bones really do. I could wiggle them about randomly and it would have no visible effect on anything as far as I have noticed.

And here’s screenshots to show the hands fitting onto a slightly uneven surface.