Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

unity-2d-core

FreeNo executable scriptsNot checked

Unity 2D fundamentals — Sprite Renderer, Sprite Atlas v2 (master/variants), 9-slice rendering, Sorting Layers vs Order in Layer vs Sorting Group, sprite…

claude-dev-suiteby claude-dev-suite★ 51 GitHub stars

About this skill

Unity 2D Core

Sprite import settings (pixel art)

Texture Type        Sprite (2D and UI)
Sprite Mode         Single (or Multiple for sprite sheets)
Pixels Per Unit     32 (or 16 / 64 — pick ONE project-wide)
Mesh Type           Tight (saves overdraw on alpha sprites)
Pivot               Bottom for floor-anchored entities; Center for projectiles
Filter Mode         Point (no filter) for crisp pixel art; Bilinear for smooth art
Compression         None (pixel art) — Compression artifacts wreck pixels
Generate Mip Maps   Off for 2D

For HD vector-style art: keep PPU consistent; use Bilinear filter; allow ASTC/Crunch compression (mobile size).

Sprite Atlas v2

Atlas = combine many sprites into one texture so they share a draw call.

Window > 2D > Sprite Atlas
- Type: Master (default) or Variant (low-res derivation)
- Include in Build: ON
- Allow Rotation / Tight Packing: tune for empty space vs runtime cost
- Object for Packing: drag folders/sprites in

Variants: a 0.5 scale Variant of a Master atlas → mobile gets the smaller textures, desktop the master. Toggle by build target.

SpriteAtlasManager.atlasRequested for late-bound atlases (Addressables-friendly).

Sorting

Three orthogonal mechanisms, applied in this order:

  1. Sorting Layer — broad strokes (Background, World, Characters, FX, UI).
  2. Order in Layer — fine integer within a layer.
  3. Sorting Group — wraps a parent + children so they sort as one unit (a knight + their weapon + their VFX).

Sorting Group is the key tool for multi-part 2D characters — without it, Z-fighting between sprite parts ruins the look.

// Optional dynamic order based on Y (top-down RPGs)
void LateUpdate() => _renderer.sortingOrder = -(int)(transform.position.y * 100);

9-slice

For UI panels, banners, expandable decorations:

Sprite Editor → Border (left/right/top/bottom in pixels)
Sprite Renderer → Draw Mode = Sliced (or Tiled)

Drag the Sprite Renderer scale → corners stay rigid, edges stretch / tile.

PPU consistency

Pick one PPU for all sprites in a level. Mixing 16 and 32 sprites in the same scene creates inconsistent pixel sizes and sub-pixel sampling artifacts.

For mixed art assets that genuinely have to coexist: use Sprite > Edit Sprite to set custom physics shapes and pivots, but keep PPU equal.

Pixel Perfect Camera

Add PixelPerfectCamera component to your Camera. Settings:

Reference Resolution    320 × 180  (or 480 × 270, 640 × 360 — base canvas)
Assets PPU              same as your sprites
Crop Frame              Letterbox (preserves aspect, adds black bars)
                        or Stretch Fill (stretches; only for tiny variations)
Pixel Snapping          ON  (snaps every renderer to integer pixels)
Upscale Render Texture  ON for clean integer scaling

Without Pixel Perfect Camera you get sub-pixel jitter as the camera moves.

AI-assisted sprite pipeline (Aseprite-native tools)

For static sprites (props, items, environments, tiles) AI generators are productive. No AI tool today produces ship-ready output zero-touch — every sprite needs an Aseprite cleanup pass before importing into Unity.

Tools that install as Aseprite extensions

Tool Cost Model Output license Offline
Retro Diffusion Full (astropulse.itch.io/retrodiffusion) $65 one-time Local pixel-art SD (Nvidia GTX 1050 Ti+ or Mac M1+) Yours, commercial OK Yes
PixelLab (pixellab.ai) $10–50/mo Cloud (zero hardware) Yours, commercial OK (no model-training on outputs) No
PixelAI (red335.itch.io/pixelai-local-ai-directly-in-aseprite) Free / pay-what-you-want Local SD (auto-download, Windows + Nvidia recommended) Yours, commercial OK Yes
Retro Diffusion Lite $20+ one-time Local pixel-art SD Yours, commercial OK Yes

All four install via Edit > Preferences > Extensions > Add Extension and expose AI panels inside the Aseprite UI.

License pitfalls (avoid for shipping)

  • Leonardo.ai free tier — Leonardo retains rights to your outputs. Paid only for full ownership.
  • Recraft free tier — outputs owned by Recraft, made public in gallery.
  • Scenario.com free tier — "personal/evaluation only", do not ship.
  • Midjourney / DALL-E / Recraft — produce anti-aliased "pixel-styled" output, not crisp pixels. Need 8× nearest-neighbour downscale + palette quantise to be usable as sprites.

Mandatory cleanup before Unity import

  1. Spritefusion Pixel Snapper (spritefusion.com/pixel-snapper) — free Rust CLI that snaps off-grid pixels back onto integer coordinates and quantises the palette. Run on every AI-generated sprite before opening in Aseprite.
  2. Aseprite touch-up — palette unification, edge cleanup
Full SKILL.md on GitHub

Install unity-2d-core in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

Read
Grep
Glob
Write
Edit

FAQ

What does the unity-2d-core skill do?

Unity 2D fundamentals — Sprite Renderer, Sprite Atlas v2 (master/variants), 9-slice rendering, Sorting Layers vs Order in Layer vs Sorting Group, sprite import settings, Pixels Per Unit (PPU), Pixel Perfect Camera, point filtering. USE WHEN: importing sprites, packing atlases, controlling draw order in 2D, setting up pixel-art rendering, configuring 9-slice UI/decorations. DO NOT USE FOR: Tilemap (use `unity-2d-tilemap`); 2D physics (use `unity-2d-physics`); animation (use `unity-2d-animation`); 2D Lights (use `unity-2d-lighting`).

How do I install the unity-2d-core skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the unity-2d-core skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare unity-2d-core with