Skip to main content
‹ Back to Tutorials
Intermediate Unity

Unity Playmaker 2D Platformer - Enemy Arm and Unity IK Bones

Nov 12, 2021
About this tutorial

In thisUnity Playmaker 2D Platformer - Enemy Arm and Unity IK Bones tutorial, I'll start setting up the enemy arm using the Unity 2D Animation IK Bone system. Then I'll also be able to set up a target that will control the bones of the arm and move the target which will move the whole arm. (to Joi

Written Guide

This tutorial rigs the eyeball boss's arm with Unity's 2D bone system so a single IK target can pose the entire limb — a setup you build once and duplicate for every arm. It uses the 2D Animation package's skinning editor plus two components: Sprite Skin and IK Manager 2D.

Import the arm as pixel art

Set the arm sprite to Sprite (2D and UI) with 24 pixels per unit, and switch filter mode to point (no filter) — that's what keeps pixel art crisp instead of blurry. Apply. Then confirm the 2D Animation package is installed via the Package Manager; it's what adds the skinning editor you're about to use.

Draw the bones

Open the Sprite Editor and switch to the Skinning Editor. This arm needs five bones. Click Create Bone — a red dot marks each bone's start (double-click the sprite if it doesn't appear) — then click and drag to lay the first bone. Chained clicks continue the line, but when the next bone starts at a different joint, right-click to deselect, select the previous bone, and click at the new joint to branch from it. Repeat down the arm. The visibility panel (toggle it on if hidden) lets you set sort order per bone if the arm needs depth layering.

Bind bones to the sprite

Bones don't deform anything until geometry connects them to pixels. Click Auto Geometry and Generate Selected with the defaults — Unity creates vertices weighted to each bone. They won't line up perfectly with the bones, but the defaults are fine here. Apply and close. Drag the sprite into the scene, then add a Sprite Skin component and click Create Bones to instantiate the bone hierarchy as real transforms; select each bone in the hierarchy and use the move tool to fine-tune joints like the knuckle into place.

Add IK and a control target

Add the second component, IK Manager 2D, and click the plus under solvers. Of the three options — chain, fabrik, and limb — pick chain, since this is a whole chain of bones. That creates a Solver 2D object. Now create two empties at the tip of the last bone: one named effector, duplicated as target; parent the target under the solver, then drag both into the solver's effector and target slots. Finally set the chain length by dragging right — a green dot appears per bone added — choosing how many bones the IK controls. Take the full line. Grab the target and the whole arm follows it. Duplicate the finished rig for the remaining arms — next tutorial, this eyeball starts attacking the player.

Unity tools by Bliz Studio
Built for our own games — now on the Asset Store

Multi Tag — unlimited hierarchical tags for any GameObject. Hierarchy Pro — style your whole hierarchy with rules. Made by a Unity dev, for Unity devs.

Explore our Unity assets →