Godot Atlas Sprite Shifts After Trimming? Check AtlasTexture Margin
Check the source region, logical dimensions, and draw offset to diagnose a trimmed sprite that shifts.


The cropped potion looks correct in the atlas, but its position changes when you switch frames. Check the logical dimensions and draw offset. This example targets Godot 4.5 AtlasTexture with integer coordinates and a nonzero region size on each axis.
Keep the source region fixed
Crop a 24 by 32 pixel region from an atlas and assign it to two AtlasTexture resources. Leave margin at zero in A. In B, set margin position to (4, 0) and margin size to (8, 0). Draw both from the same top-left anchor relative to a guide line and log get_size().
Compare the logical bounds
A reports 24 by 32 pixels. B reports 32 by 32, and its visible crop starts four pixels farther right when drawn from the same top-left anchor. A centered Sprite2D can shift the anchor as its logical size changes. Check the original frame size and the position of the crop within that frame before converting exporter offsets. Use the sprite sheet packer to prepare a small atlas, then set the resource fields in Godot.
Recommended tools

Sprite Sheet Splitter Guide: Extract Animation Frames for 2D Games
Learn how a sprite sheet splitter extracts clean animation frames from character sheets, VFX sheets, tiles, UI sprites, and AI-generated game assets.

Best Sprite Sheet Packer Settings for Indie Game Assets
A practical SEO-friendly guide to sprite sheet packer settings, including atlas size, padding, trimming, extrude, rotation, metadata, and recommended export settings for 2D game assets.

Smart Sprite Sheet Packer: A Practical Guide for 2D Game Developers
Learn how a smart sprite sheet packer helps indie game developers combine PNG assets into clean texture atlases with metadata for Unity, Cocos, Godot, and custom 2D game engines.
Ready to try "Godot Atlas Sprite Shifts After Trimming? Check AtlasTexture Margin"?
Use our online tools to apply this tutorial to your indie game project right away.
