Unity Sprite Sheet Slicing for AI-Generated Characters (2D Animation Setup)
How to slice an AI-generated sprite sheet in Unity's Sprite Editor, set correct import settings for pixel art, and build Animator states, plus how Sprixen's Unity package skips the manual slicing step.
Unity's 2D pipeline expects a sprite sheet to be sliced into individual sprites before it's usable in an Animation clip. For a hand-drawn sheet, you'd do that slicing once and move on. For an AI-generated character with several animations, each potentially a different sheet, doing it correctly and consistently across all of them, same pivot, same filtering, same pixels-per-unit, is where most of the setup time actually goes. This guide covers the manual Sprite Editor workflow and the settings that matter, then the Sprixen Unity Character Package that ships with slicing already done.
Import settings before you touch the Sprite Editor
Select the sheet in your Project window and check these fields in the Inspector before slicing anything:
- Texture Type: "Sprite (2D and UI)". This is required before the Sprite Editor is even available for the asset.
- Sprite Mode: "Multiple". A sheet with more than one frame needs this, not "Single," which treats the whole image as one sprite.
- Filter Mode: "Point (no filter)" for pixel art. This keeps edges sharp when the sprite is scaled; the default "Bilinear" blurs pixel art noticeably at anything other than 1:1 scale.
- Compression: "None". Compression artifacts show up as visible banding or noise around hard pixel edges, which is much more noticeable on small, high-contrast pixel art than on photographic textures.
- Pixels Per Unit: match this to your frame's pixel size, for example 32 for a 32x32 sprite. This keeps a 1-unit GameObject in your scene sized to exactly one frame, which makes positioning and physics colliders predictable later.
Slicing with the Sprite Editor
With those import settings applied, open the Sprite Editor (the "Sprite Editor" button in the Inspector, or via the Window menu). Use the Slice dropdown and choose "Grid By Cell Size," then enter the pixel width and height of a single frame. For a sheet you generated at 32x32 per frame, that's 32 and 32, regardless of how many frames the whole sheet contains. Click "Slice," then "Apply" to save the result. Grid slicing is the reliable choice here; Unity's "Automatic" slicing mode detects sprite boundaries by transparency, which works for hand-drawn sheets with irregular spacing but tends to misfire on AI-generated sheets where adjacent frames can have faint anti-aliasing artifacts that confuse the boundary detection.
Setting the pivot
Still in the Sprite Editor, each sliced sprite has its own Pivot setting, found in the Sprite Editor's inspector panel when a frame is selected, or set in bulk for all frames from the main Inspector's Pivot dropdown before slicing. The dropdown includes presets like Center, Bottom, and Custom. For a character, "Bottom" (or a Custom pivot placed exactly at the feet) keeps the character anchored to the ground across animations of different heights, the same reasoning as the bottom-center pivot used in Phaser and Godot exports: without it, a taller idle frame and a shorter crouch frame will appear to float or sink relative to each other when the animation switches.
Building animation clips from sliced sprites
Once frames are sliced, select all the frames belonging to one animation in the Project window (they'll appear as separate sub-assets under the sheet) and drag them into the Scene view onto your character GameObject, or directly into the Animation window's timeline. Unity recognizes multiple sprites being dropped together and prompts you to save a new Animation Clip asset, then automatically creates a keyframe per frame at a default frame rate, which you can adjust afterward in the Animation window. Repeat this per animation (idle, walk, attack, and so on), each becoming its own .anim clip.
Animator Controller and states
Individual Animation Clips aren't enough on their own to switch between idle and walk at runtime; that's the Animator Controller's job. Adding an Animator component to your character GameObject and assigning it a Controller asset gives you the Animator window, where each clip becomes a state (a box in the graph), and you draw transitions between them based on parameters you define, a bool like IsMoving, or a float like Speed, checked from your movement script. This is standard Unity 2D animation setup regardless of where the sprites came from; nothing about AI generation changes this part of the workflow.
Skipping the manual slicing: Sprixen's Unity package
Doing the above correctly, same PPU, same pivot, same filter mode, across every animation of every character in a roster adds up. Sprixen's Character Package for Unity (GET /v1/sprites/:id/package?engine=unity, or export_character_package with engine: "unity") ships the slicing pre-done: alongside the normalized atlas.png, it includes an atlas.png.meta file, Unity's own TextureImporter metadata format, already configured with spriteMode: 2 (Multiple), filterMode: 0 (Point, for pixel art), a spritePixelsToUnits value of 100, and a full spriteSheet.sprites list, one entry per frame, each with its correct rectangle, an alignment value of 7 (bottom-center), and a pivot of {0.5, 0} to match. Every frame gets a stable, deterministic GUID derived from the sprite's ID, so re-importing an updated export doesn't orphan references you've already wired into Animator clips or prefabs.
Drop atlas.png and its matching .meta file into your project's Assets folder together (the .meta file has to sit next to the image with the same base name for Unity to associate them on import), and the sheet imports pre-sliced, correctly pivoted, and correctly filtered, no trip through the Sprite Editor required. From there, building the Animation Clips and Animator states is the same manual step described above; Sprixen doesn't attempt to generate .anim files directly, since that format is tightly coupled to project-specific settings that are safer left to Unity's own tooling.
2D versus 3D projects, and where this fits
Everything above assumes a 2D project using Unity's Sprite Renderer pipeline, which is the common case for AI-generated pixel art and hand-painted 2D characters alike. If you're working in a 3D project and only need a 2D character as a billboarded sprite or a UI element, the same import settings (Point filtering, no compression, correct pivot) still apply, but you'd typically use a SpriteRenderer on a 3D GameObject or route the sprite through the UI system's Image component instead of a 2D physics-driven character setup. The slicing and pivot concepts don't change; only where the sliced sprite ends up attached in your scene does.
Common mistakes
- Slicing before setting Sprite Mode to Multiple. The Sprite Editor's Slice options won't behave correctly, or won't be meaningfully useful, until Sprite Mode is set to Multiple first.
- Leaving Filter Mode on Bilinear. This is the single most common reason AI-generated pixel art looks soft or blurry once it's in Unity; the source PNG is sharp, Unity's default import setting isn't.
- Mismatched Pixels Per Unit across characters. If one character was imported at 32 PPU and another at 48 PPU (because their frame sizes differ and PPU wasn't adjusted to match), they'll appear at different relative sizes in the scene even if their source art was designed at the same visual scale.
- Forgetting the pivot, then fighting jitter later. A default Center pivot works fine until you have two animations of different heights on the same character; the resulting vertical jitter is easy to misdiagnose as an animation timing bug when it's actually a pivot mismatch.
For sizing decisions before you generate, see pixel art sizes guide. For the same normalization concept applied to Phaser instead of Unity, see Phaser atlas JSON from AI sprites. Full endpoint and MCP reference: /docs and /docs/mcp.
FAQ
Do I need the .meta file, or can I just import the PNG?
You can import just the PNG and slice it manually with the Sprite Editor workflow described above; the .meta file is purely a shortcut that pre-applies the correct import settings and slicing so you don't have to. Unity will generate its own default .meta file automatically if you don't supply one.
Why does my sprite look tiny or huge in the scene after import?
Check Pixels Per Unit against your actual frame size. If PPU is set to 100 (Unity's default) but your frames are 32x32, the sprite will render at less than a third of a "1 unit" GameObject's expected scale, which usually looks tiny relative to everything else in the scene sized around 1 PPU-per-pixel-scale conventions.
Can I use Unity's Automatic slicing instead of Grid By Cell Size?
You can, but it detects frame boundaries by transparency and spacing, which is reliable for cleanly spaced hand-made sheets and less reliable on AI-generated sheets where subtle anti-aliasing near frame edges can cause it to misjudge where one frame ends and the next begins. Grid By Cell Size, using the exact frame dimensions from your generation metadata, avoids that ambiguity entirely.
Does compression really matter for small sprite sheets?
Visually, yes, more than the file size difference would suggest. Compression artifacts are more noticeable on small, high-contrast pixel art than on larger, softer textures, since a single misplaced pixel is a much larger fraction of a 32x32 sprite than of a 1024x1024 background.
How do I keep multiple characters' animations organized in one Animator Controller?
Generally you wouldn't; each character typically gets its own Animator Controller asset, even if several characters share similar state names (idle, walk, attack), since the underlying clips and any character-specific transition logic differ per character.
Ready to try Sprixen?
Generate consistent, style-locked sprites for your game. 6 free credits on signup, no credit card required.
Get Started FreeRelated Articles
How to Add Leaderboards and Cloud Save to a Vibe-Coded Browser Game (No Backend Setup)
You built a browser game with Claude Code, Cursor, Rosebud or Lovable and now it needs a leaderboard and a save system. Here's how to add both without standing up Firebase or Supabase.
How to Generate Game Sprites from Claude Code with MCP (Step by Step)
A complete walkthrough for generating style-consistent game sprites and animations from Claude Code using Sprixen's MCP server, from API key to exported Phaser package.
Build a Phaser Game in Cursor with Consistent AI Art (Sprixen MCP)
Clone the Sprixen Phaser starter, connect Sprixen's MCP server to Cursor, and generate a style-locked character with idle and walk animations that import cleanly into Phaser.