

You build your 2D game. Everything looks fine in the Scene view. But when you move the camera or scale the resolution, thin lines appear between tiles. Small gaps. Flickering seams between sprites that should be perfectly connected.
This is commonly blamed on a “Sprite Atlas bug.” In reality, it is usually caused by padding, filtering, or texture sampling behavior.
Here is how to diagnose and fix it properly.
When sprites are packed into a Sprite Atlas, Unity stores them inside a single texture. During rendering, texture filtering may sample pixels slightly outside the sprite’s defined area.
If there is no padding between sprites, neighboring pixels can bleed into each other. That creates visible lines.
Select your Sprite Atlas and check:
If padding is set to 2 or less, try increasing it to 4 or even 8.
Padding adds empty pixels around each sprite, preventing texture bleeding.
Compression can distort edge pixels slightly.
In your texture import settings:
If gaps disappear, compression was altering border pixels.
If you are making a pixel art game, filtering is often the main issue.
Check texture settings:
Bilinear or Trilinear filtering blends neighboring pixels, which creates visible seams.
Mipmaps are useful for 3D textures, but they often cause 2D tile gaps.
Make sure:
Mipmaps blend texture levels, which can introduce edge artifacts.
Sub-pixel camera movement can cause texture sampling artifacts.
If your camera position uses floating-point values like 3.12457, sprite edges may not align perfectly to pixel boundaries.
For pixel-perfect games:
If using Tilemap, verify:
Incorrect pivots can create tiny visible gaps between tiles.
Tight packing can sometimes increase bleeding because shapes are irregular.
Test switching between:
In grid-based games, disabling tight packing often reduces edge artifacts.
Unity provides an “Extrude Edges” option in sprite import settings.
This duplicates border pixels outward, reducing bleeding when filtering occurs.
Try setting Extrude Edges to 1 or 2.
If everything looks fine in the Editor but gaps appear in the build, check:
Mobile builds often use stronger compression by default.
No. This behavior comes from how GPUs sample textures. When filtering blends pixels near edges, artifacts appear if padding is insufficient.
Every game engine that uses atlases can experience this.
Visible gaps between sprites are almost always caused by texture sampling and insufficient padding.
The most reliable fixes are increasing atlas padding, disabling mipmaps, and using proper filtering settings.
Once your texture import settings are correct, tile seams and sprite gaps disappear permanently.