Unity 2D Tilemaps

Hal Brooks
2 min readOct 14, 2021

Objective: Create a small 2D tilemap in Unity.

For layer tilemap for 2D game.

In a 2D Unity 2020.3.20f1 project, right click in hierarchy and choose 2D object > tilemap > rectangular to create a Grid. Open Grid and rename the child tilemap to Ground_Tilemap, set the order in layer to 2. Create three more tilemaps named Farground_ with order 0, Midground_ with order 1 and Vegetation_Tilemap with order 2 for the Grid. The color of Farground_Tilemap was adjusted to distinguish it from the Midground_Tilemap. The components for each tilemap layer is shown below.

Tilemap layers for the game.

Creation of palettes was previous described, and four palettes will be used to create the different layers. The Caverns palette is used to create the farground and midground. The grounds items palette is used to create the ground, and vegetation and foreground items are used to the vegetation layer. Each of these pallets is shown below.

Four palettes used to create the tile map.

Each tilemap is created by selecting one or more sprites from a palette with the paint brush tool active and painting the scene as shown below. The white box is a gizmo showing the cameras view area. To focus on a tilemap, Tilemap can be selected from the menu for Focus On in lower right of scene view. Another tip is to inactivate or uncheck the tilemaps in the inspector that are not being painted.

Painting the tile map using a palette.

The individual tilemaps are shown in the image below, so that each layer can be easily seen. The final game map is shown at the beginning of this article with all tilemaps active.

Four tilemaps that are part of the grid for the 2D game.

--

--