Import AI Sprites into Godot 4 with SpriteFrames (AnimatedSprite2D Guide)
tutorial9 min

Import AI Sprites into Godot 4 with SpriteFrames (AnimatedSprite2D Guide)

How to get AI-generated sprite sheets into Godot 4 using SpriteFrames and AnimatedSprite2D, with the Sprixen Godot addon, the manual slicing path, and common import mistakes.

Godot 4's animation system is built around two pieces: an AnimatedSprite2D node, and a SpriteFrames resource that holds one or more named animations, each a list of frames with its own speed and loop setting. Getting an AI-generated sprite sheet into that shape is mostly mechanical, but it's easy to get the frame slicing, the pivot, or the texture filter wrong in ways that only show up once the character is moving. This guide covers both the automated path (Sprixen's Godot addon and Character Package export) and the manual path for anyone starting from a raw sprite sheet.

TL;DR: Either install the Sprixen Godot addon and import directly from the editor, or download a Godot Character Package (engine=godot) for a ready-made character.tres and character.tscn. If you're slicing a raw sheet by hand, use the SpriteFrames panel's "Add frames from sprite sheet," set the Import Filter to Nearest for pixel art, and keep the pivot at the character's feet.

What the Character Package gives you

Sprixen's Character Package endpoint (GET /v1/sprites/:id/package?engine=godot, or the export_character_package MCP tool) builds three things for Godot specifically:

  • character.tres, a SpriteFrames resource that references a packed atlas.png through AtlasTexture sub-resources, one animation entry per generated animation, named after its type (walk, or walk_left if it's direction-specific), with speed set from the source fps and looping disabled for one-shot animations like attack, hurt, death, and jump.
  • character.tscn, a scene with a CharacterBody2D root and an AnimatedSprite2D child already pointed at character.tres, auto-playing idle if one exists, with its offset already set so the pivot sits at the character's feet instead of its geometric center.
  • atlas.png, every animation's frames packed into one image, padded to a uniform cell size so frames of different animations line up on the same baseline.

Drop the whole export into your project's filesystem (for example under res://sprixen/your-character/) and open character.tscn. If it plays idle correctly and the other animations are listed in the SpriteFrames panel, you're done; no manual slicing needed.

Installing the Godot addon (recommended if you're generating a lot of characters)

For a tighter loop, the Sprixen Godot addon lets you pull sprites directly into an open project without downloading and unzipping manually. Download it from sprixen.com/godot/sprixen-godot-addon.zip and unzip its contents into your project's addons/ folder. Then:

  1. In Godot, go to Project > Project Settings > Plugins and enable "Sprixen."
  2. A new "Sprixen" dock appears in the editor. Paste your API key into it (it's stored in your editor settings, not committed with the project).
  3. Click "Load sprites" to list the sprites in your Sprixen projects.
  4. Select one and click "Import to project." The addon downloads the Godot Character Package, unzips it into your project, and refreshes the filesystem so it shows up immediately in the FileSystem dock.

Manual path: slicing a raw sprite sheet yourself

If you're working from a plain horizontal PNG strip (Sprixen's default sprite-sheet output, or any sheet from another source) rather than a full Character Package, Godot's built-in slicing tool handles it without any addon:

  1. Drag the PNG into your project's res://sprites/ folder (or wherever you keep art).
  2. Select an AnimatedSprite2D node (or add one). In the Inspector, next to "Sprite Frames," choose "New SpriteFrames," then click the resource again to open the SpriteFrames panel at the bottom of the editor.
  3. In the panel's toolbar, click "Add frames from sprite sheet" (the grid icon). Pick your PNG, set the Horizontal and Vertical frame counts to match the sheet's layout, then select the cells you want (drag-select works) and confirm with "Add Frames."
  4. Rename the default animation to something meaningful (walk, idle, attack), and set its FPS in the panel, usually 8 to 12 for pixel art walk cycles.
  5. Repeat for each additional animation sheet, adding them to the same SpriteFrames resource so they're all available on one node.

Texture filtering for pixel art

Godot 4 defaults new textures to linear filtering, which blurs sharp pixel edges when a sprite is scaled up. There are three places this gets set, and any one of them can override the others depending on your setup:

  • Project-wide: Project Settings > Rendering > Textures > Canvas Textures > Default Texture Filter, set to Nearest, affects every texture that doesn't override it.
  • Per-import: select the PNG in the FileSystem dock, open the Import tab, and set Filter to Nearest. Save this as a preset (for example "2D pixel art") if you're importing many sheets, so new ones default to it automatically.
  • Per-node: any CanvasItem, including AnimatedSprite2D, has a texture_filter property you can override directly in the Inspector if you only want one specific node to render crisp while the rest of the project stays linear.

If your generated sprites still look blurry after setting the project default, check the per-texture import setting first; it takes precedence over the project default and is easy to miss when you've already imported a texture before changing the project setting.

Keeping the pivot at the feet

Sprixen's Character Package records a pivot of { x: 0.5, y: 1.0 } in its manifest, meaning bottom-center: the character's feet, not its geometric middle. In Godot, AnimatedSprite2D has a centered property; when the package's character.tscn sets it to false with a computed offset, that's what keeps the feet planted on the ground when animations of different heights (say, a crouching hurt animation next to a standing idle) play back to back. If you're slicing manually and notice your character "floating" or sinking into the floor between animations, this is almost always the cause: check that every animation's frames are padded to the same cell height with the character anchored to the bottom of that cell, not centered within it.

CharacterBody2D versus a plain Node2D

Sprixen's Godot Character Package roots the generated scene in a CharacterBody2D, the Godot 4 successor to Godot 3's KinematicBody2D, rather than a plain Node2D or Sprite2D. That's a deliberate choice for a character you intend to move around: CharacterBody2D comes with built-in collision-aware movement methods (move_and_slide, in particular) that a plain node doesn't have, so the exported scene is ready to drop a movement script onto rather than needing you to restructure the node tree first. If you're building something that never moves under its own collision, an NPC that only plays an idle animation for atmosphere, for instance, a plain Node2D root with just the AnimatedSprite2D child is perfectly reasonable, and you can safely reparent the exported AnimatedSprite2D under a simpler root if you don't need the physics body.

Why the packaged export is validated against a real Godot project

A ZIP that claims to be Godot-ready is only useful if it actually opens in Godot without errors. Sprixen validates every change to the Godot Character Package export by unzipping a real generated package into a throwaway Godot 4 project and running it headless: the check loads character.tres, confirms every animation the manifest says should exist actually exists with the right frame count, instantiates character.tscn, and only passes if all of that succeeds without the editor raising an error. This matters because a manifest and a resource file can look correct on inspection and still fail to parse in the actual engine, a stale uid string, a relative path that resolves differently than expected, a resource type mismatch, are all the kind of thing that only shows up when Godot itself tries to load the file. If you ever hit an import error with a downloaded package that this guide doesn't cover, that's the first thing worth checking: does the character.tscn reference paths relative to its own folder, or did something get moved after unzipping.

Common errors

  • Wrong frame counts in "Add frames from sprite sheet." If the Horizontal/Vertical values don't match the actual sheet layout, Godot slices garbage frames instead of erroring. Double-check the frame count against what Sprixen's animation metadata reports before slicing.
  • Blurry sprites at runtime despite a Nearest project default. Almost always a per-texture import override left at Linear from before the project setting was changed; check the Import tab on the specific file.
  • Using the Godot 3 node name. AnimatedSprite (no "2D") is the Godot 3 node; Godot 4 uses AnimatedSprite2D. Projects upgraded from Godot 3 sometimes still reference the old node type, which won't accept a Godot 4 SpriteFrames resource the same way.
  • Non-looping animations set to loop. Attack, hurt, death, and jump animations usually shouldn't repeat; set Loop off for those in the SpriteFrames panel, or your character will replay a death animation forever instead of transitioning to a game-over state.

For the broader question of why AI-generated sprites drift in style across a project in the first place, see why AI sprites look inconsistent. For sizing decisions before you even generate the sheet, see pixel art sprite sizes for games. Our original Godot setup guide, AI sprite generator for Godot, covers the generation side in more depth. Full API reference: /docs.

FAQ

Do I need the Godot addon, or is the Character Package ZIP enough on its own?

The ZIP alone is enough; the addon just saves you the download-unzip-drag step by doing it from inside the editor. If you're only importing a handful of characters, downloading the package manually is perfectly fine.

Does this work in Godot 3.x?

The Character Package's character.tres and character.tscn are built for Godot 4's node names and resource format. The PNG sheets inside the package work in any Godot version; on 3.x you'll need to build the SpriteFrames resource manually using the older AnimatedSprite node instead of relying on the pre-built scene.

Why does my character's animation play but never loop?

Check the Loop toggle for that specific animation in the SpriteFrames panel. It's set per animation, not globally, so an idle animation you added manually might default to no-loop while a walk cycle you added right after inherited a different setting depending on how you configured the panel at the time.

Can I use one SpriteFrames resource across multiple characters?

Technically yes, but it isn't recommended: each character generated with a different prompt has its own frame dimensions and pivot, so sharing one resource across characters tends to cause misalignment as soon as their proportions differ even slightly.

What resolution should I generate sprites at for Godot?

There's no Godot-specific requirement; Godot scales whatever you give it. For retro-style games, 16x16 or 32x32 are the most common starting points, scaled up in-engine with nearest-neighbor filtering to keep edges sharp. See pixel art sizes guide for the tradeoffs between sizes.

GodotSpriteFramesAnimatedSprite2DAI spritestutorial

Ready to try Sprixen?

Generate consistent, style-locked sprites for your game. 6 free credits on signup, no credit card required.

Get Started Free