---
title: Paint levels with tilemaps
product: Unity Spark
canonical: https://docs.unity.com/en-us/unity-spark/create/build/2d/tilemaps
last_updated: 2026-12-01
generated_at: 2026-12-01T21:08:14.758Z
locale: en-us
---

# Paint levels with tilemaps

> Add a tilemap, paint and erase tiles in the Tilemap Editor window, create Rule Tiles that choose their own sprites, and add collisions in Unity Spark.

A tilemap is a grid that you paint sprites onto, one cell at a time. Use tilemaps to create platforms, walls, and floors. For how tilemaps fit into a 2D game, refer to [Introduction to 2D games in Unity Spark](/unity-spark/create/build/2d/about-2d.md).

## Add a tilemap

To add a tilemap to your scene:

1. In the [Hierarchy window](/unity-spark/create/build/objects-prefabs/hierarchy-window-reference.md), select **Add object** (**+**) or right-click.
2. Select **2D Object** > **Tilemap**.
3. Choose one of the following grid shapes.

| **Shape**               | **Use it for**                                                                         |
| :---------------------- | :------------------------------------------------------------------------------------- |
| **Rectangular**         | Square cells, such as a side-scrolling platformer.                                     |
| **Hexagonal Flat Top**  | Six-sided cells with a flat top, such as a strategy map.                               |
| **Hexagonal Point Top** | Six-sided cells with a pointed top, such as a strategy map.                            |
| **Isometric**           | Diamond-shaped cells that give a three-quarter view.                                   |
| **Isometric Z as Y**    | Diamond-shaped cells that give a three-quarter view and let you stack tiles in layers. |

To add another layer to an existing hexagonal or isometric tilemap:

1. Select its grid object.
2. Add a tilemap of the same shape.

Unity Spark adds the new layer to the same grid.

## Prepare tiles to paint with

The **Tilemap Editor** window paints with sprites from textures you sliced, and with Rule Tiles. Before you paint, do one of the following:

* Slice the texture that holds your tiles in the **Sprite Editor** window. Refer to [Slice a sprite sheet](/unity-spark/create/build/2d/sprites.md#slice-a-sprite-sheet).
* Create a Rule Tile. Refer to [Create a Rule Tile](#create-a-rule-tile).

## Paint tiles

To paint tiles on a tilemap:

1. Select the tilemap object.
2. In the [Inspector window](/unity-spark/create/build/components/inspector-window-reference.md), select **Open Tilemap Editor** in the **Tilemap** [component](/unity-spark/create/build/components/about-components.md).
3. In the **Tilemap Editor** window, under **Source**, select the texture that holds your tiles.
4. Select a tile. To paint a group of tiles at once with **Paint**, drag to select them. **Rect** and **Fill** always use a single tile. You can also select a Rule Tile from the **Rule Tiles** list.
5. Select one of the tools in the following table.
6. Click or drag on the grid.

The following table describes the tools.

| **Tool**  | **Description**                                                   |
| :-------- | :---------------------------------------------------------------- |
| **Paint** | Paints the active tile. Drag to paint many cells.                 |
| **Erase** | Removes tiles. Drag to erase many cells.                          |
| **Rect**  | Fills a rectangle that you drag with the active tile.             |
| **Fill**  | Replaces a connected area of matching tiles with the active tile. |

To zoom, use the mouse wheel. To pan, drag with the middle mouse button. Unity Spark saves each stroke as you paint, and you can undo each one. **Fill** changes up to 2000 cells at a time. If the rectangle you drag with **Rect** is larger than 2000 cells, Unity Spark doesn't paint it. Drag a smaller area or zoom in.

The **Tilemap Editor** window shows the grid as a simple diagram. The real tiles appear in the [Scene view](/unity-spark/create/build/scenes/scene-view/scene-window-reference.md).

## Create a Rule Tile

A Rule Tile chooses its sprite based on the tiles next to it, so edges and corners draw correctly as you paint. A Rule Tile can also pick a random sprite, or play an animation.

To create a Rule Tile:

1. In the [Project window](/unity-spark/create/assets/manage/project-window-reference.md), select **Create** (**+**) > **2D** > **Tiles** > **Rule Tile**. For a hexagonal tilemap, select **Hexagonal Rule Tile** instead.
2. Select the new Rule Tile to edit it in the **Inspector** window.
3. Select a **Rule Type**: **Neighbour**, **Random**, or **Animation**.
4. Under **Source texture**, select a sliced texture.
5. Set the **Default sprite**.
6. Select **+ Rule** to add a rule.
7. In the rule's grid, click each cell to set what the neighboring tile must be.
8. Select a slice.
9. Select **Set** to choose the sprite for that rule.
10. Select **Save Rules**.

A **Neighbour** Rule Tile paints only on a tilemap of its own shape. A square Rule Tile paints on a square or isometric tilemap, and a hexagonal Rule Tile paints on a hexagonal tilemap. A **Random** or **Animation** Rule Tile paints on any tilemap.

## Add collisions

To make a tilemap solid, add a **TilemapCollider2D** component to the tilemap object. For how to add a component, refer to [Add 2D physics to objects](/unity-spark/create/build/2d/physics-2d.md).

The **Collider Type** of each Tile and Rule Tile asset decides its shape: **None**, **Sprite** (the outline of the sprite), or **Grid** (the whole cell).

To merge the tiles into one collider:

1. Add a **CompositeCollider2D** component to the tilemap object.
2. Enable **Used By Composite** on the **TilemapCollider2D** component.

## Additional resources

* [Add and edit sprites](/unity-spark/create/build/2d/sprites.md)
* [Add 2D physics to objects](/unity-spark/create/build/2d/physics-2d.md)
* [2D objects and components reference](/unity-spark/create/build/2d/2d-reference.md)
