How to Use Sprite Sheets in Godot 4
Use sprite sheets in Godot 4 with AnimatedSprite2D and SpriteFrames, or Sprite2D hframes with AnimationPlayer. Includes pixel-perfect settings.
· 6 min read
The short answer
To use a sprite sheet in Godot 4, add an AnimatedSprite2D node, create a new SpriteFrames resource, click 'Add frames from sprite sheet', set Horizontal to the number of frames and Vertical to the number of rows, select the frames and add them. Set the animation speed in FPS, enable Loop for cycles like idle and walk, and call play("walk") from your script. For pixel art, set the default texture filter to Nearest so pixels stay sharp.
Two ways to animate a sheet
Godot 4 gives you two good options. AnimatedSprite2D with a SpriteFrames resource is the quickest: you get a visual frame editor, per-animation FPS and looping, and simple play() calls. It is the right default for characters and enemies.
Sprite2D with hframes and vframes plus an AnimationPlayer is more flexible. You set Hframes to the number of columns, then keyframe the 'frame' property over time. Because AnimationPlayer can also key hitboxes, sounds and method calls on the same timeline, many developers use it for attacks where a hitbox must appear on a specific frame.
Step-by-step with AnimatedSprite2D
- 01Download the sprite (PNG) or the sprite sheet from SpriteLab and copy it into your Godot project folder.
- 02For pixel art, set Project Settings → Rendering → Textures → Default Texture Filter to 'Nearest' so pixels stay sharp.
- 03Single sprite: add a Sprite2D node and drag the PNG into its Texture property.
- 04Animation: add an AnimatedSprite2D, create new SpriteFrames, click 'Add frames from sprite sheet', set Horizontal to the number of frames and Vertical to 1, select all frames and add them.
- 05Set the animation speed (e.g. 8–12 FPS), enable Loop for idle and walk cycles, and call play() from your script.
Pixel-perfect settings
Godot 4 filters textures per canvas item rather than at import. The project-wide default lives at Project Settings → Rendering → Textures → Canvas Textures → Default Texture Filter; set it to Nearest for pixel art. You can override it on individual nodes with the Texture Filter property under CanvasItem → Texture.
For the window, set Display → Window → Stretch → Mode to 'viewport' and the base viewport size to your low game resolution (for example 320×180 or 640×360). From Godot 4.2, Stretch → Scale Mode 'integer' keeps scaling to whole numbers. Enabling Rendering → 2D → Snap 2D Transforms to Pixel helps avoid sub-pixel shimmer on moving sprites.
- Default Texture Filter: Nearest.
- Stretch Mode: viewport, Scale Mode: integer (4.2+).
- Snap 2D Transforms to Pixel: on for strict pixel art.
- Keep all sprites at the same pixel density so they line up with the TileMap.
Driving the animation from code
A minimal character script in GDScript checks velocity and switches animations: if the body is moving horizontally, play 'walk' and set flip_h from the direction; otherwise play 'idle'. Calling play() with the animation that is already running does not restart it, so it is safe to call every frame.
For one-shot animations such as attack or hurt, disable Loop in SpriteFrames and connect the animation_finished signal to return to idle. Use the frame_changed signal, or an AnimationPlayer track, if gameplay needs to react on a specific frame.

Alternative: Sprite2D + AnimationPlayer
If you need frame-exact gameplay events, this setup keeps everything on one timeline. It takes a minute longer than SpriteFrames but scales well to complex attacks.
- 01Add a Sprite2D node and assign the sprite sheet to its Texture.
- 02In the Inspector under Animation, set Hframes to the number of frames in the row (and Vframes to the number of rows, usually 1).
- 03Add an AnimationPlayer as a sibling, create a new animation and set its length (for example 0.6 s for 6 frames at 10 FPS).
- 04Select the Sprite2D and click the key icon next to the Frame property at each time step, increasing the frame number by one each time.
- 05Set the track's update mode to Discrete, enable looping for cycles, and add extra tracks for hitboxes, sounds or method calls on the frames where they belong.
Where the sheet comes from
Godot's sheet import is easiest when every frame is the same size and the sheet is a single row, because Horizontal equals the frame count and Vertical is 1. SpriteLab's Animate tool exports exactly that — a transparent horizontal strip of equal-size frames, plus a frames ZIP if you prefer to drag individual images into SpriteFrames, and a GIF to preview.
Frequently asked questions
Should I use AnimatedSprite2D or AnimationPlayer in Godot 4?
Use AnimatedSprite2D for straightforward frame animation. Use Sprite2D with AnimationPlayer when you need to keyframe other properties, such as hitboxes or sounds, in sync with specific frames.
Why are my sprites blurry in Godot 4?
The texture filter is Linear. Set Project Settings → Rendering → Textures → Canvas Textures → Default Texture Filter to Nearest, or change Texture Filter on the node.
How do I set the FPS of an AnimatedSprite2D animation?
In the SpriteFrames panel, select the animation and change the speed value (FPS) next to the animation list. 8–12 FPS suits most pixel art.
Is there a SpriteLab Godot plugin?
No. SpriteLab exports standard PNG files and sprite sheets that you import with Godot's built-in tools; no plugin is required.