StykAnimate

Inverse kinematics (IK)

Drag a hand or foot and let the elbow or knee follow. Pin feet to the floor, choose the bend side and the chain length.

8 minIntermediateStykAnimate 1.2.5

With IK you pose an arm or a leg by its end: put the hand where it should go and the elbow bends by itself. On this page you learn to switch IK on and off for a joint, pin feet to the floor, and choose which way a knee bends.

The short version
  • IK (inverse kinematics) means: drag a hand or foot, and the elbow or knee follows. Blue's hands and feet have it on; their dots have a blue ring.
  • Click a joint and use Properties → IK: Use IK, Pinned, Stretch, Chain and Direction.
  • Pinned keeps a hand or foot where it is while the body moves. Shift-drag the orange dot to take the pins with you.

What IK does

There are two ways to pose an arm. Without IK (this is called FK, forward kinematics) you turn the upper arm, then the forearm, one line at a time. With IK you drag the hand and StykAnimate works out both angles for you.

Without IK (FK)
  • Drag a joint: only its line turns.
  • You set every angle yourself.
  • Best for swings, waves and follow-through.
With IK
  • Drag the end: the whole limb bends to reach.
  • Pin an end and it stays put.
  • Best for feet on the floor and hands on things.

You can mix both in one animation, even on one figure: IK on the feet so they stay on the ground, FK on the arms for a nice swing. IK never adds joints or changes the figure's design; it only decides the angles of the lines that are already there.

IK on Blue

Blue, the figure every new project starts with, has IK on both hands and both feet. Each one moves two lines (a Chain of 2), bends whichever way it already bends (Direction: Both), and is not pinned.

  1. Drag Blue's hand. The elbow bends to reach it. If you pull past where the arm can reach, the arm goes straight and the hand stops.
  2. Click the hand and look at Properties. The heading reads Left forearm (the line that ends at that hand), and the IK section shows Use IK switched on.
  3. Drag the orange dot. Nothing is pinned yet, so the whole of Blue moves, hands and feet included.

Pin feet to the floor

A pin holds a hand or foot in its place on the stage. Move the body and the pinned limb bends to stay there, as long as it can reach. It is how you make a character crouch, lean or walk without the feet sliding.

WatchPinned feet

    Unpinned, dragging the hips carries the feet. Pinned, the knees bend and the feet stay on the floor while the hips move.
    1. Put the feet where they should stand. Click one foot.
    2. In Properties → IK, switch on Pinned. Do the same for the other foot.
    3. Drag the orange dot down. The knees bend and the feet stay planted: Blue crouches.
    4. To move Blue somewhere else with his pinned feet, hold Shift and drag the orange dot. The pins travel with him.

    Keep the body within reach. If you drag the hips too far, the leg straightens and the foot comes off its pin; drag back and it lands again. To take a step, drag the pinned foot to its new place (the pin moves with it), or switch Pinned off, move the foot and switch it on again.

    Try it

    Do the tasks in order. Click a hand or foot to see its settings in Properties; the highlighted lines are the ones its IK moves.

    Try itIK and pins
    Click a hand or foot, then drag it
    0 of 6 done
    1. Drag a hand: the elbow bends to follow.
    2. Click a foot and switch on Pinned.
    3. Drag the orange dot down: the knee bends, the foot stays.
    4. Shift-drag the orange dot: the pin comes along.
    5. Pick Left or Right in Direction: the knee or elbow flips side.
    6. Switch Use IK off, then drag that end: only its own line turns.

    Switch IK on or off for a joint

    Any joint can lead an IK chain, not only hands and feet.

    1. Click the joint that should lead, for example a hand.
    2. In Properties → IK, switch on Use IK. Its dot gets a blue ring, and the IK options appear under the switch.
    3. Pinned is already on: a new IK joint starts pinned where it is, so nothing jumps. Switch it off if you just want an easier way to pose the limb.
    4. Check Chain (2 for a normal arm or leg), then drag the joint a little to try it.

    Switching Use IK off keeps the pose exactly as it is on screen; from then on, dragging that joint turns only its own line. The same goes for switching Pinned off: nothing jumps.

    The IK settings

    SettingWhat it doesUse it for
    Use IKDragging the joint moves its whole chain. Off: it turns only its own line.Hands and feet you want to place.
    PinnedThe joint keeps its place on the stage (and its angle) while the body moves.Feet on the floor, a hand on a wall.
    StretchWhen you pull past the limb's reach, the chain grows to follow. Back in reach, it returns to its normal length.Cartoon reaches. Leave it off for normal limbs.
    ChainHow many lines, counting back from the joint, IK may turn. 1 turns only the forearm; 2 the whole arm; 3 also bends the body.2 for arms and legs. More for tails and tentacles.
    DirectionLeft or Right forces the bend to one side; Both (the default) keeps whichever way it bends now.A knee that keeps flipping the wrong way.
    RotationTurns whatever hangs below the IK joint (a foot after an ankle, say) around it, in degrees.Pointing a foot while the ankle is pinned.

    Left and Right are measured along the limb, from its start towards the joint you drag: they are not the character's left and right. Try one, and if the knee goes the wrong way, pick the other.

    Keys and gestures

    Move the chain with IKOn a joint with a blue ringDrag
    Move the bodyOn the orange dot; pinned joints stay where they areDrag
    Move the body and its pins togetherOn the orange dot; a Shift-click without dragging still adds to the selectionShift+Drag
    Cancel the dragBefore you let goEsc

    Good to know

    • The app draws nothing extra for IK. A pin has no separate marker: the joint's normal dot is the target. If a pinned foot is out of reach, drag the hips back towards it.
    • Joined figures count too. A chain can run across a join, so a hand on a separate arm figure can still bend the arm it is joined to.
    • Two chains can't share a line. Both arms can start at the same shoulder, but if you make both chains long enough to share the body, the app refuses the second one. Shorten one Chain.
    • Pins hold through playback. A pinned foot stays planted in the frames in between too, not just on the frames you posed.
    • Save as .styk or .stkz to keep IK. Pivot's .piv files can't store IK settings; exporting to Pivot keeps the poses but not the switches. .stk figures don't carry them either.

    Common mistakes

    The foot slides when I move the body

    The foot isn't pinned, or the body moved out of reach. Click the foot and check Pinned; drag the hips closer. Press Ctrl+Z to undo the last move.

    The knee bends backwards

    Pick the other side in Direction, or drag the foot through the straight position to the side you want.

    Turning Use IK on froze the joint

    That is the pin: a new IK joint starts pinned. Switch Pinned off to drag it freely with the body.

    Common questions

    The hand stops before it reaches the mouse.

    The arm is fully stretched. Move the body closer, or switch on Stretch if a longer arm is what you want. Ctrl-drag doesn't stretch an IK hand.

    I can't grab a joint that's out of reach.

    Grab the dot where you see it, at the end of the straight arm, and drag it back into reach.

    I switched IK off and the arm stayed bent.

    That is on purpose: switching off keeps the pose you see. Undo if you want the switch and the pose back as before.

    I'm used to Pivot. Do I have to use IK?

    No. Switch Use IK off and every joint turns only its own line, the way you pose in Pivot. IK settings are saved in .styk and .stkz files only.

    Keep going

    Still stuck?

    Ask the community, or tell us what’s missing from the docs.