UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

assets

[Tilemap] Atlas Slicing Misalignment: Grid Display Errors Fixed

Solution

tilemaps2d developmentspritestextures

Unity 2021.x - Unity 6.3.x

Published Tue, Mar 17

Issue

 When importing a texture for a Tilemap, the entire atlas is treated as a single tile within the Tile Palette. This occurs because the texture asset is not sliced, causing multiple tiles to occupy a single grid cell despite the Grid Cell Size settings.

Explanation

The issue occurs because the Tile Palette interprets the entire texture as a single Sprite asset by default. To resolve this, the Sprite Mode of your texture must be adjusted to allow partitioning into individual sub-assets.

  1. Select your texture asset in the Project window.
  2. Locate the Sprite Mode property in the Inspector and change it from Single to Multiple.
  3. Click Apply at the bottom of the Inspector.
  4. Open the Sprite Editor window.
  5. Select the Slice dropdown, set the Type to Grid By Cell Size (or Grid By Cell Count), and enter the dimensions of your individual tiles.
  6. Click Slice, then click Apply in the top-right corner of the Sprite Editor.
  7. Drag the resulting sliced sub-assets into your Tile Palette to create the Tile assets.

Additional Tips:

  • Ensure the Pixels Per Unit (PPU) matches your tile dimensions to maintain a 1:1 ratio with the Grid Cell Size.
  • If tiles appear with bleeding edges, set the Filter Mode to Point (no filter) and Compression to None.
  • For automated workflows, consider using the Sprite Custom Physics Shape if your tiles require complex collision bounds.

TL;DR

The Sprite Mode must be set to Multiple to allow for manual or grid-based slicing within the Sprite Editor.


Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.