Paint tiles into the scene
Create a tilemap and paint tiles onto it using the Tile Palette window.
Read time 3 minutesLast updated 13 days ago
After you create a tile palette, create a tilemap in the scene and paint your tiles onto it.
Create a tilemap in the scene
- Make sure the 2D Sprite package is installed in your project. For more information, refer to set up your project for 2D games.
- In the Hierarchy window, right-click and select >2D Object
?
to display the available tilemap types.Tilemap?
- Select the tilemap type that matches your tile palette. The default tilemap type is Rectangular.
Unity creates the following:
- A grid GameObject. This is a layout guide that extends infinitely in all directions.
- A child tilemap GameObject. This is the tilemap that you paint your tiles onto.
Select the grid or the tilemap to display its grid in the Scene view.
Paint tiles onto the tilemap
Follow these steps:
-
Open the Tile Palette window and select a tile palette.
-
Set Active Target () to the tilemap you want to paint onto.
-
In the toolbar, select the Paint with Active Brush () tool.
-
Select a tile from the tile palette. This makes the tile the active brush and highlights it with a white outline. To select multiple tiles, click and drag.To select a tile from the tilemap in the Scene view instead of the tile palette, hold Ctrl (macOS: Cmd) and select a tile in the Scene view.
-
Paint into the Scene view.
To fill areas with tiles instead, or draw lines or paint random tiles, use the other tools and scriptable brushes in the Tile Palette window. For more information, refer to Tile Palette editor tools.
Move and edit tiles
To select a tile in the Scene view for editing, follow these steps:
- In the Tile Palette window, select the Select (
) tool in the toolbar.
- Select a tile in the Scene view, or click and drag to select a group of tiles.
You can then do the following:
- To move a tile, select the Move (
) tool in the toolbar, then click and drag the tile to the new location.
- To change the size of a tile, in the window, edit the Scale properties in the Grid Selection Properties section.Inspector
?
When you select a tile with the Select tool, the Inspector window displays more properties and settings for editing the tile. For more information, refer to Grid selection properties reference.
Delete tiles
To delete a tile in the Scene view, use one of the following methods:
- Select a tile with the Select tool, then press the Delete (macOS: Backspace) key.
- Select the Paint with Active Brush tool, then hold the Shift key while clicking.
- Select the Erase with Active Brush tool (
), then click tiles. To erase multiple tiles at a time, select the Paint with Active Brush tool first, then click and drag an area on the tile palette that's the size you need.
Add another tilemap to the grid
You can add multiple tilemaps to a grid.
To add a tilemap, in the Hierarchy window, right-click a grid GameObject then select 2D Object > Tilemap.
Additional resources
- Tilemap class (Scripting API)
- Tiles for tilemaps
- Tile palettes
- Tilemap Collider 2D