In this lesson, you will learn how to distinguish between Forward Kinematics (FK) and Inverse Kinematics (IK) to better control character limb movement.
Forward Kinematics (FK)
Think of FK as the "top-down" approach to posing. In an FK system, you rotate the shoulder, then the elbow, and finally the wrist to place a hand in a specific location. You define the rotation of every parent bone in the hierarchy to arrive at the position of the child (the hand). While this is great for fluid, artistic animations, it is difficult to use for precise tasks, like reaching for a specific door handle, because you must manually calculate every angle to ensure the hand lands exactly where you want.
Inverse Kinematics (IK)
IK flips this logic, treating the movement as a "bottom-up" process. Instead of rotating the shoulder and elbow, you provide a target position (the goal). The system then calculates the necessary rotations for the shoulder and elbow to make the hand arrive at that target.
Imagine your character needs to lean against a wall. Instead of manually animating the character’s hand to match the wall’s position, you place an IK target on the wall surface. The IK system automatically adjusts the arm's joints so the hand reaches the target while maintaining realistic limb constraints.
The Technical Distinction
- Forward Kinematics: You define joint rotations The tip (end effector) follows.
- Inverse Kinematics: You define the target position The joints rotate to solve the path.
In Unity, you often see this used for foot placement on uneven terrain. Rather than having the character's feet clip through sloped ground, the IK solver dynamically adjusts the knee and ankle rotations so the foot "snaps" to the surface of the terrain mesh.
// Conceptual logic for an IK solver:
void Update() {
// We set the target's position
handTarget.position = doorHandle.position;
// The IK solver calculates:
// ShoulderRotation = Solve(target, elbow, shoulder);
// ElbowRotation = Solve(target, hand, elbow);
}
By understanding this difference, you can choose when to use manual keyframed animation (FK) and when to use procedural systems (IK) to keep your character interactions looking grounded and responsive.
Key Takeaway: While Forward Kinematics dictates how joints move to reach a point, Inverse Kinematics calculates joint rotations based on a desired destination.