[Tilemap] Eliminate Isometric Sprite Overlaps with Correct Depth Sorting
Solution
Unity 2021.x - Unity 6.3.x
Published Sun, Mar 15
Tiles within an Isometric Tilemap exhibit unexpected overlapping artifacts. This occurs despite configuring the Transparency Sort Axis (e.g., Y = -0.26) and setting the Tilemap Renderer mode to Individual. Adjustments to tile pivots and Isometric Z as Y settings often fail to resolve these visual discrepancies when tiles originate from multiple source textures, leading to rendering inconsistencies in the 2D environment.
The root cause of depth sorting discrepancies in an Isometric Tilemap is often the use of individual sprite files for each tile instead of a unified spritesheet. When the Tilemap Renderer batches these separate textures, it can fail to calculate the correct draw order relative to the Transparency Sort Axis because the assets reside on different texture layers.
- Consolidate all individual tile graphics into a single PNG image to create a spritesheet.
- Import your spritesheet into Unity and set the
Texture TypetoSprite (2D and UI). - Open the
Sprite Editorand slice the spritesheet using a consistent pivot point (e.g.,Bottomfor isometric tiles) to ensure the engine anchors every tile correctly. - Create a new
Tile Paletteand populate it by dragging the sliced sprites from your spritesheet into the palette window. - Assign the new tiles to your tilemap and set the
Tilemap Renderermode toIndividualto force the engine to sort tiles based on their pivots rather than batching them into static chunks.
Additional Tips
- Set the
Transparency Sort ModetoCustom AxisinProject Settings>Graphicsand verify the axis is set to (0, 1, -0.26) for 2:1 tiles. - Ensure the
Orientationproperty on theGridcomponent is set toIsometricorIsometric Z as Yto match your perspective. - If artifacts persist, check that your spritesheet does not have extraneous transparent padding that exceeds the tile boundaries, as this can confuse the depth calculation.
TL;DR
Consolidate individual sprite assets into a single spritesheet to fix depth sorting. Construct the Tile Palette using sliced sprites from a unified texture to ensure consistent batching and rendering.
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.