Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

unity-tilemap-2d — Claude Code skill: what it does, how to install

Builds and scripts 2D tilemaps in Unity 6.3 LTS using Grid components, Tile Palette, and runtime C# methods. Useful when laying out levels, setting up colliders, or generating procedural rooms.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-tilemap-2d -a claude-code
Open on GitHub

What unity-tilemap-2d does

This skill guides the agent through setting up Grid objects, Tilemap layers, and sorting orders in Unity 6.3 LTS (6000.3). It defines workflows for slicing sprite sheets into tile assets and painting levels inside the Tile Palette.

For physics, the skill configures TilemapCollider2D together with CompositeCollider2D and a static Rigidbody2D. Unity 6 replaces the obsolete usedByComposite flag with Collider2D.compositeOperation = CompositeOperation.Merge. That eliminates seams between adjacent tiles. Procedural scripts generate regions with SetTilesBlock and BoundsInt instead of slow per-cell loops.

Remember that RuleTile and animated tiles fail to compile without the separate com.unity.2d.tilemap.extras package. You must add it via Package Manager before generating auto-tiling code. To update edited tiles, the agent prefers RefreshTile(cell) over full-map refreshes that cause frame drops.

What it helps with

  • merge tile colliders into one composite shape using CompositeCollider2D
  • generate procedural floors and walls using SetTilesBlock and BoundsInt
  • set up auto-tiling logic with RuleTile and extra brushes
  • translate world positions to cell coordinates via WorldToCell

Example prompts for the agent

  • Generate a C# script to paint a floor using SetTilesBlock on the ground tilemap
  • Set up a CompositeCollider2D on the wall Tilemap using Unity 6 compositeOperation
  • Write a helper method that checks if a world position has a tile

How to install unity-tilemap-2d

1Skills CLI (Vercel)

npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-tilemap-2d -a claude-code

2Manually: put the files in place

~/.claude/skills/unity-tilemap-2d/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/unity-tilemap-2d/

From the same set40

The whole set →
game-feel gamedev-skills Teaches the agent to add feedback to game actions: camera shake, hit-stop, eased tweens, squash and stretch, knockback. For mechanics that work but feel weightless. Claude Code CX Codex Cursor +1 9,400installs game-ui-ux gamedev-skills Engine-neutral game UI architecture skill for responsive layouts, screen stacks, gamepad focus, and event-driven HUD updates. Claude Code CX Codex Cursor +1 9,200installs level-design gamedev-skills Plans playable game levels from blockout through playtesting, covering routes, pacing, gates and encounters. Use it when working on whiteboxes, critical paths or room flow. Claude Code CX Codex Cursor +1 7,500installs camera-systems gamedev-skills Engine-neutral patterns for 2D and 3D game cameras: smooth follow, deadzones, look-ahead, bounds clamping, and third-person collision. Claude Code CX Codex Cursor +1 7,100installs audio-design gamedev-skills A skill that treats game audio as a mixer graph: buses, gain in decibels, sidechain ducking, adaptive music and beat-synced events. Samples use Godot 4.7, Unity gets notes. Claude Code CX Codex Cursor +1 7,100installs performance-optimization gamedev-skills A skill that turns “the game runs slow” into a measured bottleneck and a specific fix: profile first, then pool objects, batch draw calls, cut allocations. Claude Code CX Codex Cursor +1 7,100installs game-ai gamedev-skills Designs NPC decision-making, behavior trees, steering forces, and A* pathfinding. Useful when building game enemy logic across engines. Claude Code CX Codex Cursor +1 7,100installs input-systems gamedev-skills Engine-neutral input system: map keys to named actions, rebinding with conflict detection, keyboard, gamepad and touch support, analog deadzones, input buffering and coyote time. Claude Code CX Codex Cursor +1 6,800installs

Similar

Questions about unity-tilemap-2d

How do I install unity-tilemap-2d in Claude Code?

Run npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-tilemap-2d -a claude-code.

What does unity-tilemap-2d do?

It provides workflow guidelines and C# patterns for authoring 2D tilemaps in Unity 6.3 LTS, covering Grid setups, Tile Palette brushes, merged colliders, and runtime tile editing.

Why are RuleTile assets missing or causing errors?

RuleTile and Animated Tiles are not part of the Unity core engine. They require installing the com.unity.2d.tilemap.extras package version 6.0.x through the Package Manager.

Source text

SKILL.md · Apache-2.0
---
name: unity-tilemap-2d
description: >
  Build and script 2D tilemaps in Unity 6.3 LTS: the Grid + Tilemap components, the Tile Palette,
  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.
---

# Unity 2D Tilemap

Author and script tile-based 2D levels in Unity 6.3 LTS with the `Grid`/`Tilemap` system, the Tile
Palette, colliders, and runtime painting. Targets **Unity 6.3 LTS (6000.3)**.

> **Package note:** the core Tilemap (`Grid`, `Tilemap`, `Tile`, `TilemapCollider2D`) is
> built in, and so is the Tile Palette with its default brush. **Rule Tiles, Animated Tiles,
> and the extra brushes (Random, Line, GameObject, Group) live in the separate "2D Tilemap
> Extras" package (`com.unity.2d.tilemap.extras`, 6.0.x for Unity 6.3)** — install it via
> Package Manager before using `RuleTile`.

## When to use

- Use when laying out a 2D level by painting tiles, setting up a `Grid` + `Tilemap`, adding
  collision to the map, using auto-tiling Rule Tiles, or generating/editing tiles from script.
- Use when scenes contain a `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`.

## Core workflow

1. **Create the grid:** GameObject → 2D Object → Tilemap → Rectangular (the `Grid`'s **Cell
   Layout** also offers Hexagonal and Isometric for hex/iso levels). This makes a `Grid`
   with a child `Tilemap` (+ `TilemapRenderer`). Use one Tilemap per layer (background,
   ground, foreground) and set each renderer's sorting.
2. **Open the Tile Palette** (Window → 2D → Tile Palette), drag in a sliced sprite sheet to
   create `Tile` assets, then paint with the brush tools.
3. **Add collision** to the solid layer: `TilemapCollider2D`. For one merged collider (far
   cheaper and gap-free), also add `CompositeCollider2D` (+ a `Rigidbody2D` set to **Static**)
   and set the tilemap collider's **Composite Operation** to **Merge**.
4. **Auto-tile with Rule Tiles** (2D Tilemap Extras) so edges/corners pick the right sprite
   automatically instead of hand-placing every variant.
5. **Edit at runtime via script** with cell coordinates (`Vector3Int`): `SetTile`, `GetTile`,
   `SetTilesBlock`, converting world↔cell with the `Grid`/`Tilemap`.
6. **Verify** in Play mode: confirm collisions (Physics Debugger), sorting order, and that
   `RefreshAllTiles` ran after bulk edits.

## Patterns

### 1. Painting tiles at runtime (cell coordinates)

```csharp
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;
}
```

### 2. Bulk fill a region (faster than per-cell `SetTile`)

```csharp
// 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);
}
```

### 3. Clearing and refreshing

```csharp
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.
```

## Pitfalls

- **`RuleTile` type not found** — it's not built in. Install the **2D Tilemap Extras** package
  (`com.unity.2d.tilemap.extras`) via Package Manager.
- **A collider per tile tanks performance / leaves seams** — add a `CompositeCollider2D` with a
  static `Rigidbody2D` and set Composite Operation to **Merge** to merge the whole layer into
  one smooth shape.
- **No "Used By Composite" checkbox, or an obsolete warning on `usedByComposite`** — Unity 6
  replaced it with **Composite Operation** (`Collider2D.compositeOperation`). Old
  `usedByComposite = true` maps to `CompositeOperation.Merge`; write that instead.
- **Small gaps remain between merged tiles** — raise the Tilemap Collider 2D's **Extrusion
  Factor** so neighbouring tile shapes fall within the Composite Collider 2D's Vertex Distance.
- **Confusing world and cell coordinates** — `SetTile`/`GetTile` take a `Vector3Int` _cell_,
  not a world position. Always convert with `WorldToCell` / `CellToWorld`.
- **Tiles render behind/in front of sprites unexpectedly** — set each `TilemapRenderer`'s
  Sorting Layer and Order in Layer; multiple tilemaps need explicit ordering.
- **Rule/animated tiles don't update after script edits** — refresh after writes, but prefer
  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.
- **Painting onto the wrong layer** — the active target Tilemap in the Tile Palette determines
  where paint lands; check the "Active Tilemap" dropdown.

## References

- Primary docs: Unity Manual "Tilemaps"
  (`https://docs.unity3d.com/Manual/tilemaps/work-with-tilemaps/tilemap-reference.html`),
  `ScriptReference/Tilemaps.Tilemap`, `ScriptReference/Collider2D-compositeOperation`, the
  Manual "Tilemap Collider 2D component reference", and the 2D Tilemap Extras package manual
  (`https://docs.unity3d.com/Packages/[email protected]/manual/index.html`) for
  Rule Tiles. (`@6.0` is the version that ships with Unity 6.3 LTS; the old `@1.6` docs are
  for Unity 2021-era projects.)

## Related skills

- `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.

© gamedev-skills · Apache-2.0 · gamedev-skills/awesome-gamedev-agent-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor