Unity
Export a sprite as a pre-sliced, point-filtered Unity sprite atlas with a pivot at the feet (experimental).
The unity format writes the atlas PNG with a ready Unity .meta file. Drop both into a Unity project and the atlas imports as a pixel-art sprite sheet: point filtering, no compression, no mipmaps, and one named sprite per frame, each with its pivot at the feet.
Warning
The unity format is experimental: its file layout may change in a minor release, because Unity's importer format differs slightly between versions. It targets Unity 2021 LTS, 2022 LTS and Unity 6. mode8 schema --section formats shows the stability of every format.

Export#
Make a starter project to follow along, then export its hero:
mode8 init my-game --template platformer
cd my-game$ mode8 export assets/hero/frames --out-dir exports/unity --name hero --formats unity --animations assets/hero/master.m8.json
✓ Exported hero (15 frames) → exports/unity/
unity · 15 files
animations attack, hurt, idle, jump, walk
palette nes_master_gothic from mode8.toml
Next:
mode8 verify --assets-dir exports/unityYou get two files that belong together:
hero_atlas.png, the packed frames (plushero_atlas.json, the same atlas JSON every engine format writes);hero_atlas.png.meta, the import settings Unity reads for that PNG.
The .meta sets what pixel art needs, and slices the frames by name:
$ grep -E 'filterMode|spriteMode|spritePixelsToUnits|alphaIsTransparency|textureCompression' exports/unity/hero_atlas.png.meta
filterMode: 0
spriteMode: 2
spritePixelsToUnits: 16
alphaIsTransparency: 1
textureCompression: 0
$ grep -A8 'name: idle' exports/unity/hero_atlas.png.meta
name: idle
rect:
serializedVersion: 2
x: 1
y: 147
width: 64
height: 72
alignment: 9
pivot: {x: 0.5625, y: 0}
--
name: idle_1
rect:Show 27 more lines
serializedVersion: 2
x: 66
y: 147
width: 64
height: 72
alignment: 9
pivot: {x: 0.5625, y: 0}
--
name: idle_2
rect:
serializedVersion: 2
x: 131
y: 147
width: 64
height: 72
alignment: 9
pivot: {x: 0.5625, y: 0}
--
name: idle_3
rect:
serializedVersion: 2
x: 196
y: 147
width: 64
height: 72
alignment: 9
pivot: {x: 0.5625, y: 0}filterMode: 0 is Point (no filter), spriteMode: 2 is Multiple (one sprite per frame) and textureCompression: 0 keeps every color exact. Each sprite's alignment: 9 is a custom pivot, at the feet, in Unity's bottom-left texture space.
Import it#
- Copy
hero_atlas.pngandhero_atlas.png.metainto your project'sAssets/folder, together, while the Unity editor is open or closed. - Select the atlas in the Project window: Texture Type is Sprite (2D and UI), Sprite Mode is Multiple, and its arrow unfolds the frames
idle,walk_0and so on. - Drag a frame into the scene. It stands on its feet at the GameObject's position.
To animate, select an animation's frames (for example walk_0 to walk_3) and drag them into the Scene view together; Unity makes an Animation Clip and an Animator for them. Set the clip's sample rate (Show Sample Rate in the Animation window's menu) to the animation's fps from hero_atlas.json:
$ sed -n '/"animations"/,/"hurt"/p' exports/unity/hero_atlas.json
"animations": {
"attack": {
"frames": [
"windup",
"attack",
"recover"
],
"fps": 8,
"loop": false,
"durations": [
2,
1,Show 4 more lines
2
]
},
"hurt": {Mode 8 does not write Animation Clips yet.
Options#
--pixels-per-unit N(1 to 4096, default 16) sets how many pixels make one Unity unit. Use the same value for every sprite and tile in a game, and match your camera to it (the 2D Pixel Perfect Camera's Assets Pixels Per Unit).--guid-namespace NAMEmixes a name into the file's GUID and sprite IDs. They are derived from the export name and the frame names, so exporting again keeps every reference (prefabs, clips, scenes) intact. Two different projects that both export aherointo one Unity project would collide; give each its own namespace:
$ mode8 export assets/hero/frames --out-dir exports/unity --name hero --formats unity --pixels-per-unit 32 --guid-namespace my-game
✓ Exported hero (15 frames) → exports/unity/
unity · 15 files
animations attack, hurt, idle, jump, walk
palette nes_master_gothic from mode8.toml
Next:
mode8 verify --assets-dir exports/unityPitfalls#
- The frames are not sliced. The
.metadid not travel with the PNG, so Unity made its own. Delete the atlas fromAssets/, then copy both files again. - Blurry or banded sprites. Something changed the import settings after the import: set Filter Mode back to Point (no filter) and Compression to None, or copy the
.metaagain. - The sprite floats or sinks. Every frame shares the pivot of the idle frame. A hand-made sprite with feet at another height needs its own pivot in the Sprite Editor.
Next#
- Exporting: formats, timing and the atlas JSON.
- Checks: verify an export before you hand it over.
- Stability and versioning: what "experimental" allows.