/unity-dev:unity-2d-animationfrom unity-dev
Guides skeletal 2D character setup in Unity: PSB rigging, bones/weights, sprite swaps, and 2D IK using the 2D Animation package.
Ships in unity-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A bone turns a sprite from a quad the 2D renderer batches for nothing into a skinned mesh. Every vertex is moved by up to four bones every frame, on the CPU unless four separate conditions hold, and each part of the character is its own renderer. A twelve-part runner is twelve skinned meshes; a patrol of twenty sentries is two hundred and forty. Frame animation pays in texture memory and nothing per frame; skeletal animation pays per vertex, per part, per frame. Choose per character, and count before the art is drawn.
| The situation | Read |
|---|---|
| "Bones or frame-by-frame"; what a rig costs in memory, CPU and draw calls; when GPU deformation is on and why a part fell back; mixing both on one character | reference/skeletal-vs-frames.md |
"Import this PSB as a character"; importing a PSB; mosaic, rig and layer-group settings; a .psd that imports as one flat texture; "the bones came off after a layer was renamed"; sharing one skeleton between two PSBs | reference/psd-to-rig.md |
"Rig this PSB automatically"; bones, meshes, weights from layer names or a rig file; idle, blink, talk, a side-view run; a bone imported as head_1 | reference/auto-rig-2d.md |
Live2D Cubism: the Cubism-ready PSD, the SDK for Unity, .model3.json, blink, lip sync, licences | reference/live2d-import.md |
Skinning Editor order; "the elbow folds like paper"; a part left behind when the body moves; SpriteSkin states, Auto Rebind, bounds and culling; one part passing in front of another on the same sprite | reference/bones-and-weights.md |
| Sprite Library assets, categories and labels; "swap the helmet at runtime"; a whole-skin swap; animating the resolver; variant libraries; a swapped part frozen in its bind pose | reference/sprite-library.md |
| IK Manager 2D; Limb, CCD or FABRIK; "the 2D leg bends backwards"; IK on top of a clip; feet on a slope | reference/ik-2d.md |
Frame clips: equal-canvas frames into an AnimationClip | unity-2d-sprites → reference/sprite-animation.md |
| Sprite metadata from script; the bone and mesh data providers on the importer | unity-2d-sprites → reference/data-provider.md |
| Animator parameters and the bridge that writes them | unity-animation → reference/parameter-contract.md |
| The idle, run, jump, fall, hurt graph over these clips | unity-animation → reference/sprite-state-graph.md |
| Footsteps, hit windows and other events on a clip | unity-animation → reference/events-and-windows.md |
| A limb drawn over the torso when it should be under; Sorting Group on a multi-part character | unity-2d-rendering → reference/sort-order.md |
| Packing the parts with the art | unity-sprite-atlas |
| Where frame time goes once the rig is in | unity-profiling → reference/where-the-time-goes.md |
| Adding the 2D packages | unity-new-project → reference/package-bootstrap.md |
Copy resources/SkinSwap.cs into a Runtime assembly that references Unity.2D.Animation.Runtime,
and resources/Editor/SpriteLibraryBuilder.cs and resources/Editor/SkinningAudit.cs into an
Editor one that also references Unity.2D.Animation.Editor; the auto-rig adds
resources/Editor/AutoRig2D.cs and Rig2DLayout.cs there, resources/RigDriver2D.cs at
runtime, and EditMode tests in resources/Tests/Editor/. IK types live in a third assembly,
Unity.2D.IK.Runtime, under UnityEngine.U2D.IK.
PSB layers ─► PSD Importer ─► sprites + a prefab ─► Skinning Editor ─► SpriteSkin on each part
(mosaic, rig) (one renderer/layer) bones→geometry→weights (bone Transforms)
per frame: Animator writes bone Transforms
SpriteResolver (order −20) picks the sprite a part shows
IKManager2D (order −10) LateUpdate: solvers overwrite the limb chains
SpriteSkin (order +10) deforms the mesh from the Transforms it finds
| Layer | Owns | Never knows about |
|---|---|---|
The .psb and its .meta | layers, sprite ids, bones, geometry, weights | the scene |
SpriteSkin | which Transform drives which bone of the sprite it shows | what the pose means |
SpriteLibrary + SpriteResolver | which sprite a category and label resolve to | bones |
IKManager2D and its solvers | the last word on a limb chain each frame | game state |
| The Animator | bone rotations and resolver keys over time | devices, physics |
The bones are ordinary Transforms. Anything that can rotate a Transform animates the rig, and anything that renames, re-parents or deletes one breaks it without a compile error.
grep -n -A1 '"com.unity.2d.animation"\|"com.unity.2d.psdimporter"' Packages/packages-lock.json
grep -n 'meshDeformation' ProjectSettings/ProjectSettings.asset # 0 CPU · 1 GPU · 2 GPU (Batched)
grep -rn 'm_UseSRPBatcher' --include='*.asset' Assets Settings 2>/dev/null
com.unity.feature.2d brings both; a 3D project adds
com.unity.2d.animation and com.unity.2d.psdimporter. Majors pair with the Editor: 13.x and
12.x on 6000.3, 14.x and 13.x on 6000.4, one major per Editor after that (VERSIONS.md).
Everything in resources/ compiles on 6000.3 and 6000.4.meshDeformation: 0, or no URP, or the SRP Batcher off — every SpriteSkin deforms on the
CPU and the 2D renderer batches the results. That is the right default for many small parts.reference/skeletal-vs-frames.md says when that
wins and which features silently push a part back to the CPU.reference/skeletal-vs-frames.md.psb (not .psd), one layer per part, unique layer names,
neutral pose. Import Mode Individual Sprites (Mosaic), Use as Rig on.
→ reference/psd-to-rig.mdAutoRig2D rigs a PSB that follows the layer names, with a face library
and a driven variant → reference/auto-rig-2d.md. By hand: bones, geometry,
weights, then Apply → reference/bones-and-weights.md.resources/Editor/SkinningAudit.cs, one JSON object:unity command eval 'return SkinningAudit.Json("Assets/Art/Runner");'
problems is 0 when no vertex is unweighted, no weight names a missing bone, and every
SpriteSkin is Ready. The characters rows are the budget: skins, bone Transforms,
vertices and triangles one instance deforms each frame.
5. Make the swappable parts a library. resources/Editor/SpriteLibraryBuilder.cs builds a
.spriteLib from Helmet/courier.png-style folders or from helmet_courier-style sprite
names; it reports and waits. resources/SkinSwap.cs changes skins and equipment at runtime.
→ reference/sprite-library.md
6. Add IK only to chains gameplay has to place — a hand on the gate switch, feet on a
sloped roof. → reference/ik-2d.md
7. Hand the clips to the Animator. Parameters, states, events and transitions are the same
as for any other clip: unity-animation → reference/parameter-contract.md.
| Frame clip | Skeletal, CPU deformation | Skeletal, GPU deformation | |
|---|---|---|---|
| Paid in | texture area: one cell per frame | CPU: vertices × influences, per part, per frame | GPU compute, plus one SRP-batched draw per part |
| Renderers per character | 1 | 1 per layer | 1 per layer |
| Batches with its neighbours | yes, same atlas and material | yes — the 2D renderer batches deformed parts | per-object draws; no dynamic batching |
| New animation costs | a new set of frames | a clip of rotations: kilobytes | the same |
| Breaks when | the canvas or pivot differs between frames | a bone Transform is renamed or missing | also: a MaterialPropertyBlock, a sprite mask, a ShadowCaster2D sourced from the skin |
| Fits | few frames, pixel art, effects, crowds | many low-vertex parts | a few high-vertex characters |
Off-screen cost is a switch on each side: SpriteSkin.alwaysUpdate and IKManager2D.alwaysUpdate
both default to on. Turn them off on anything that is not the runner and a culled sentry stops
deforming and solving.
characters row..meta until
Apply.category_label.
Rename either and every clip and prefab keyed on it stops changing the sprite, with no error.AddOverride with a library asset does not refresh. Call RefreshSpriteResolvers()
after it, or use resources/SkinSwap.cs, which does.weight; do not key the bones of a chain and solve it at full
weight at once.SpriteSkin, no weights, and it batches as a plain sprite.localScale.x sign or a 180° turn about
Y. A negative scale on one bone mirrors what hangs from it and nothing else, and the rig's
left and right stop agreeing.| Not here | Go to |
|---|---|
| Animator state graphs, blend trees, override controllers; 2D lights and shadows on the character | unity-animation; unity-2d-rendering |
| Slicing, pivots, an Aseprite or sheet source | unity-2d-sprites |
| Moving the character: grounding, jumps, slopes, facing from velocity | unity-2d-controller |
| Colliders and hitboxes that follow a bone | unity-physics-2d → reference/bone-colliders.md |
| Pixel-art filtering and camera snapping | unity-2d-pixel-perfect |
| 3D rigs, Humanoid Avatars, Mixamo | unity-rigged-character |
| Rigging and animating a 3D mesh in Blender | character-autorig (game-assets plugin) (default) · blender-character-rig (hand-built fallback) |
| Generating the layered artwork; the layer split and rig file | codex-visual; comfyui-asset-generation |
| Recording a run and asserting on it | unity-play-harness |
reference/auto-rig-2d.md (opens in a new tab)reference/bones-and-weights.md (opens in a new tab)reference/ik-2d.md (opens in a new tab)reference/live2d-import.md (opens in a new tab)reference/psd-to-rig.md (opens in a new tab)reference/skeletal-vs-frames.md (opens in a new tab)reference/sprite-library.md (opens in a new tab)resources/Editor/AutoRig2D.cs (opens in a new tab)resources/Editor/PoseRaster2D.cs (opens in a new tab)resources/Editor/Rig2DLayout.cs (opens in a new tab)resources/Editor/SkinningAudit.cs (opens in a new tab)resources/Editor/SpriteLibraryBuilder.cs (opens in a new tab)resources/FaceDriver2D.cs (opens in a new tab)resources/RigDriver2D.cs (opens in a new tab)resources/SkinSwap.cs (opens in a new tab)resources/Tests/Editor/AutoRig2DTests.cs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub tipoli5890/game-studio --plugin unity-dev51 skills in this plugin
/unity-2d-controllerMove a 2D character: platformer jump, slopes, coyote time, moving platforms, top-down movement./unity-2d-gridGrid tactics and tile puzzles, hex or square: move range, A* paths, line of sight, turns, undo./unity-2d-level2D level layout as data: Tiled/LDtk import, rooms, endless chunks, seeded levels, jump reachability./unity-2d-pixel-perfectBlurry, shimmering or seamed pixel art in Unity: Pixel Perfect Camera, import settings, snapping.