Introduction to Tilemap in Unity

Let’s start with the new project and begin by introducing a new element of Unity, what is the Tilemap and how to use it.

The Tilemap component is a system that stores and manages Tile Assets for the creation of 2D layers. It transfers the necessary information from the Tiles placed on it to other related components such as the Tilemap Renderer and the 2D Tilemap Collider.

To create a Tilemap, automatically the Grid component is generated, and it works as a grid where you place your tiles for the creation of the layer.

To work with the Tilemap you must use the Tile Palette that is a tab of Unity that you find under the voice, Windows>2D>Tile Palette

Open the new tab you have to create the palette object.

To use this system you must modify the sprites so that they can be used for palettes.

First, select the sprite and under Sprite Mode, select “Multiple”. Then open the Sprite Editor and select the Slice item to split the sprites.
Once done click on Apply.

Now select the sprite that will become a group of sprites one for each square. Drag it into the Tile Palette tab to create the tiles to associate with the palette that was created earlier.

Now you can have fun creating your layer using the tile drawing tools in Unity’s Scene View.

project manager by day, unity developer by night