Sprite sheets in Godot 4
Godot gives you two clean ways to use a sprite sheet, and which one you want depends on how the sheet was packed. Both start with a sheet made in the Sheet Maker.
What you need
- A sprite sheet PNG (uniform grid for path A, any packing for path B).
- For path B: the coordinates of each frame — export Godot Atlas JSON or JSON Hash from the Maker alongside the PNG.
Path A — uniform grid sheet with AnimatedSprite2D (built-in)
- Copy the sheet PNG into your Godot project folder. It imports automatically as a Texture2D.
- Add an AnimatedSprite2D node to your scene. In the Inspector, set its Sprite Frames property to a new SpriteFrames resource, then click the resource to open the SpriteFrames editor at the bottom of the window.
- Create an animation (for example
walk) in the animations list on the left of that editor. - Click "Add frames from a sprite sheet" (the grid icon above the frame strip). Choose the sheet texture, set the horizontal and vertical frame counts to your grid, then click the cells that belong to this animation in order, and confirm with Add Frames.
- Set the animation's FPS and loop toggle in the SpriteFrames editor, then press play on the node or call
play("walk")from GDScript. Adjust the node's Offset or the frames' alignment if the character drifts — all frames share the cell, so keep the ground line consistent in the source art.
This path needs no data file at all: the grid is the data. That is why the Maker's grid mode aligns frames bottom-centre — Godot slices by cell, not by content.
Path B — packed atlas with AtlasTexture regions
- Pack with the Maker using MaxRects + trim, and export the data file (Godot Atlas JSON gives you a
regionper sprite). - In Godot, create an AtlasTexture resource (for example as the texture of a Sprite2D, or inside a theme). Set its Atlas property to the sheet PNG.
- Set the AtlasTexture Region rectangle to the frame's
x, y, w, hfrom the JSON. The Sprite2D now shows exactly that frame. - Repeat per frame, or write a short editor/import script that reads the JSON and generates one AtlasTexture per frame — the JSON is plain TexturePacker-style data, so
JSON.parse_stringin GDScript handles it directly.
Trim pitfall: if you packed with trimming on, a frame's region is its trimmed rectangle. AtlasTexture shows the trimmed art; to restore the original in-game position, also apply the spriteSourceSize offset from the export (the Maker records it in JSON Hash/Array formats). For character animation, packing uniform untrimmed grids (Path A) avoids this entirely.
Next steps
Need the sheet first? Open the Maker. Have a GIF instead of frames? Convert it, then follow Path A. Working in Unity instead? See the Unity guide.