Tutorial: Meadow Quest (2D RPG)

2. Paint the meadow

Build a 21×21 tilemap with three layers (ground, decorations, walls) and place it in a new scene.

The finished meadow: grass, the path, bushes, rocks, and stone walls with a gap for the gate

The map has three layers, drawn on top of each other:

LayerzWhat goes on it
Ground0grass everywhere, the path down the middle
Decor1bushes and rocks
Walls2stone walls round the edge, and a fence across the middle with a 3-tile gap

How to create the map

  1. In the Project panel, open Assets/Tilemaps (create the folder if needed), right-click empty space and choose Create > Tilemap. A map called New Tilemap appears. On the web editor its name can't be changed yet; that's fine, the name only matters to you.
  2. Select it and click Open in Tilemap in the Inspector (or double-click it). A new map is 21 × 21 cells of 1 world unit each.

How to add the tiles

  1. Click + Add tile. In the picker, type mq in the filter box.
  2. Click each tile you need to select it: the three grass tiles, the three path tiles, the wall, the bush and the rock. Then click Add 9 selected.

The Tilemap window: nine tiles in the tileset, and two layers

How to paint the Ground layer

  1. Click the plain grass tile in the Tileset, then the Fill tool (the paint bucket), and click the grid. The whole map turns green.
  2. Click the second grass tile, then the Pencil, and dab it onto a third of the cells, here and there. Do the same with the flower tile on a few cells.
  3. Click path-left, choose Rect, and drag a rectangle down column 10 (counting from 1), from the top edge to the bottom. Then path down column 11 and path-right down column 12.

How to paint the Decor and Walls layers

  1. Click + Layer. A new layer appears above Ground, at z 1. Make sure it's selected (it's highlighted) and paint a few bushes and rocks with the Pencil.
  2. Click + Layer again for the walls (z 2). With the wall tile and Rect, paint:
    • the outer ring: the top row, the bottom row, the left column and the right column;
    • the fence: row 9 from the top, from column 2 to column 9, and from column 13 to column 20. Leave columns 10–12 empty: that's the gate's opening.
  3. Click Save.

How to place it in a scene

  1. File > New Scene. It opens empty.
  2. Right-click empty space in the Hierarchy, then Create Empty 2D.
  3. With it selected, Add Component > Tilemap, and pick your map in the Map list.
  4. The map is drawn from the entity's position as its bottom-left corner. To centre it on the origin, set Origin to -10.5 and -10.5 (double-click a number field to type).
  5. Rename the entity to Meadow: select it, press F2, type, and press Enter.
  6. Save the scene with Ctrl+S.

The Meadow entity: the Tilemap section with the map, and Origin -10.5, -10.5

Good practices

  • One job per layer. Ground, decorations and walls on separate layers let you repaint one without disturbing the others, and decide what draws over what.
  • Odd sizes centre nicely. A 21-wide map has a middle column (11), so a 3-wide path and a 3-wide gate sit exactly in the centre. Origin −10.5 puts that middle on x = 0.
  • Mix variants sparingly. About two thirds plain grass, a third of the second grass tile, and flowers on one cell in ten.
  • Undo removes tiles too. Undo walks back every step, including + Add tile. If your tileset empties, click Redo.
  • Tiles don't block anything yet. The painted walls are only pictures; in Part 5 you put invisible colliders on top of them.

This part's assets

meadow.tgtilemap and its .mt, the finished map. It uses the nine tile images from Part 1; import those first.

Next: hero & camera →