# Add 3D height to an isometric tilemap

> Create 3D height on an isometric tilemap using either multiple tilemaps, or a Z as Y isometric tilemap.

To create 3D height on an isometric tilemap, use either of the following methods:

* Use an **Isometric** tilemap, and create a separate tilemap for each level of 3D height.
* Use an **Isometric Z as Y** tilemap, and set the 3D height of tiles as you paint.

> **Note:**
>
> If you set the **Mode** of a tilemap to **Chunk**, tiles from multiple textures can sort incorrectly. To avoid this, pack all your tile sprites into a single sprite atlas. For more information, refer to [sprite atlases](/engine/6000.3/manual/unity2d/sprite/atlas.md).

## Use an Isometric tilemap

To add a new tilemap at a higher level of 3D height, follow these steps:

1. Select the grid GameObject in the **Hierarchy** window, then in the Editor window set **Cell Layout** to **Isometric**.
2. In the **Hierarchy** window, right-click the grid GameObject and select **2D Object > Tilemap** to create a new tilemap as a child of the grid.
3. In the **Inspector** window of the new tilemap, set **Order in Layer** to a higher value. This makes sure Unity renders the new tilemap in front of the original tilemap.
4. To move the tilemap up in 3D height, increase the **x** and **y** values of the **Tile Anchor** property. For example, add 0.5 to both the **x** and **y** values.
5. In the **Tile Palette** window, set **Active Target** () to the new tilemap.
6. Paint the tiles into the Scene view.

## Use an Isometric Z as Y tilemap

In an Isometric Z as Y tilemap, each tile has a z value that represents its 3D height. Unity adds the z value to the 2D y position of the sprite, to position it higher up in the scene.

Follow these steps:

1. Select the grid GameObject in the **Hierarchy** window, then in the **Inspector** window set **Cell Layout** to **Isometric Z as Y**.

2. In the [2D renderer asset](/engine/6000.3/manual/unity2d/2d-urp/2drenderer-data-overview.md), set the **Transparency Sort Mode** to **Custom Axis**.

3. Set the **z** value of **Transparency Sort Axis** to the z-axis sort value.

   To calculate the z-axis sort value, take the **y** value of the **Cell Size** of the grid GameObject, multiply it by negative 0.5, then subtract 0.01. For example, if the **y** value of the grid is 0.5, the z-axis sort value is 0.5 × -0.5 - 0.01 = -0.26.

   If you don't set the z-axis sort value, tiles at higher 3D heights can render in front of tiles at lower 3D heights.


   **A tower on an isometric grid. On the left, the z value of Transparency Sort Axis is 0, and the tiles of the tower sort incorrectly. On the right, the z value is -0.26, and the tiles sort correctly.:**
   ![](/api/media?file=/engine/6000.3/media/images/Iso-axis-compare.png)

4. In the **Tile Palette** window, disable **Lock Z Position**.

5. Set **Scene View Z Position** to the 3D height you want to paint at. For example, set **Scene View Z Position** to 1 to paint tiles one unit above the ground.

   You can also press **-** and **+** to increase and decrease the 3D height of the tile while you paint.

The Scene view displays a white outline of the tile at ground level, and a blue outline of the tile at the 3D height.


**The Scene view with the brush preview and the blue and white outlines.:**
![](/api/media?file=/engine/6000.3/media/images/2D_IsoTilemap_8.png)

To change whether the mouse pointer selects a tile in the blue outline or the white outline, use the **Mouse Grid Position At Z** property in the [Tile Palette tab reference for the Preferences window](/engine/6000.3/manual/unity2d/tilemaps/reference/tile-palette-preferences.md).

To remove a tile with the **Erase** tool, set **Scene View Z Position** to the same 3D height value as the tile you want to remove.

To adjust the gap between 3D height layers, select the grid GameObject and adjust the **z** value of the **Cell Size** property.

## Position sprites between tiles

By default, tilemaps render in Chunk mode, which means that Unity renders multiple tiles together in single batches. This approach increases performance and ensures tiles sort correctly, but other objects in the scenes can't appear between tiles at different depths.

To avoid this, follow these steps to set tilemaps to render in Individual mode:

1. In the **Hierarchy** window, select the tilemap GameObject.
2. In the **Inspector** window, in the **Tilemap Renderer** component, set **Mode** to **Individual**.

Unity now sorts tiles and sprites together, so characters and other objects can appear between tiles at different depths. Individual mode can reduce performance, because Unity renders each sprite individually on the tilemap.


**A meadow with a tower on an isometric tilemap. A character stands behind the castle so their bottom half is correctly hidden behind the castle.:**
![](/api/media?file=/engine/6000.3/media/images/2D_IsoTilemap_14.png)

## Additional resources

* [Introduction to tilemaps](/engine/6000.3/manual/unity2d/tilemaps/tilemaps.md)
