gamedev-skills/unity-tilemap-2d
> tilemap colliders, rule tiles, and runtime SetTile/GetTile painting. Use when painting tile levels, adding a TilemapCollider2D, using rule or animated tiles, generating tilemaps from code, or when the user mentions Unity tilemap, tile palette, rule tile, or Grid.
npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill unity-tilemap-2d
Author and script tile-based 2D levels in Unity 6 with the Grid/Tilemap system, the Tile
Palette, colliders, and runtime painting. Targets Unity 6 (6000.0 LTS).
> Package note: the core Tilemap (Grid, Tilemap, Tile, TilemapCollider2D) is
> built in. **Rule Tiles, Animated Tiles, and Tile Palette brushes live in the separate
> "2D Tilemap Extras" package (com.unity.2d.tilemap.extras)** — install it via Package
> Manager before using RuleTile.
Grid + Tilemap, addingcollision to the map, using auto-tiling Rule Tiles, or generating/editing tiles from script.
Grid with Tilemap children, or *.asset tile/palette files.When _not_ to use: level _design_ practice (pacing, blockout, layout principles) →
level-design. 3D tile/grid placement → Unity's own 3D tooling (ProBuilder / grid brushes; no dedicated skill here). The platformer character that
moves over the tiles → platformer / unity-physics.
Gridwith a child Tilemap (+ TilemapRenderer). Use one Tilemap per layer (background,
ground, foreground) and set each renderer's sorting.
create Tile assets, then paint with the brush tools.
TilemapCollider2D. For one merged collider (farcheaper and gap-free), also add CompositeCollider2D (+ a Rigidbody2D set to Static)
and enable _Used By Composite_ on the tilemap collider.
automatically instead of hand-placing every variant.
Vector3Int): SetTile, GetTile,SetTilesBlock, converting world↔cell with the Grid/Tilemap.
RefreshAllTiles ran after bulk edits.
using UnityEngine;
using UnityEngine.Tilemaps;
public class TilePainter : MonoBehaviour
{
[SerializeField] private Tilemap tilemap; // assign the target Tilemap
[SerializeField] private TileBase groundTile;
// World position -> cell, then place a tile.
public void PaintAt(Vector3 worldPos)
{
Vector3Int cell = tilemap.WorldToCell(worldPos);
tilemap.SetTile(cell, groundTile);
}
public bool IsSolid(Vector3 worldPos)
=> tilemap.GetTile(tilemap.WorldToCell(worldPos)) != null;
}
SetTile)// SetTilesBlock writes a whole BoundsInt in one call — use it for procedural rooms/floors.
public void FillFloor(Tilemap map, TileBase tile, int width, int height)
{
var bounds = new BoundsInt(0, 0, 0, width, height, 1);
var tiles = new TileBase[width * height];
for (int i = 0; i < tiles.Length; i++) tiles[i] = tile;
map.SetTilesBlock(bounds, tiles);
}
tilemap.SetTile(cell, null); // null erases the tile at that cell
tilemap.RefreshTile(cell); // re-evaluate just this cell's rule/animated neighbors (cheap)
// RefreshAllTiles() re-evaluates the ENTIRE map — reserve it for full regenerations, not per-edit.
RuleTile type not found — it's not built in. Install the 2D Tilemap Extras package(com.unity.2d.tilemap.extras) via Package Manager.
CompositeCollider2D with astatic Rigidbody2D and _Used By Composite_ to merge the whole layer into one smooth shape.
SetTile/GetTile take a Vector3Int _cell_,not a world position. Always convert with WorldToCell / CellToWorld.
TilemapRenderer'sSorting Layer and Order in Layer; multiple tilemaps need explicit ordering.
the targeted RefreshTile(cell) for a few edits; RefreshAllTiles() re-evaluates every tile
on the map and stalls large levels. Reserve the full refresh for whole-map regenerations.
where paint lands; check the "Active Tilemap" dropdown.
(https://docs.unity3d.com/Manual/tilemaps/work-with-tilemaps/tilemap-reference.html),
ScriptReference/Tilemaps.Tilemap, and the 2D Tilemap Extras package manual
(https://docs.unity3d.com/Packages/[email protected]/manual/index.html) for
Rule Tiles.
level-design — engine-agnostic blockout, pacing, and tile layout practice.procedural-gen — generating the tile data (noise, RNG, dungeons) you feed to SetTilesBlock.platformer / roguelike — genres that compose this skill with movement and generation.Take gamedev-skills/unity-tilemap-2d from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.