# AI Tilemap — Unity Extension

AI Tilemap (com.ivanmurzak.unity.mcp.tilemap) — 2D tilemaps — create grid + tilemap, paint / box-fill / clear tiles, tile and rule-tile assets, collider and orientation. An AI Game Developer extension for Unity that adds 5 capabilities through RQL (no extra MCP tools).

_Last updated: 2026-10-17_

## At a glance

| Field | Value |
| --- | --- |
| Capabilities | 5 capabilities |
| Version | 2.0.0 |
| Package id | com.ivanmurzak.unity.mcp.tilemap |
| Engine | Unity · Unity 2022.3+ |
| Base plugin | com.ivanmurzak.unity.mcp |
| Wraps | com.unity.modules.tilemap |
| Repository | https://github.com/IvanMurzak/Unity-MCP/blob/main/extensions/Tilemap/README.md |
| RQL sources | tilemap |
| RQL functions | tilemap.tileAt, tilemap.cell, tilemap.tiles, tilemap.count, tilemap.cells, tilemap.worldToCell, tilemap.cellToWorld |
| RQL types | Tilemap, RuleTile |

## How it works

Adds no MCP tools: it contributes an RQL module with the tilemap source, the tilemap.tileAt, tilemap.cell, tilemap.tiles, tilemap.count, tilemap.cells, tilemap.worldToCell, tilemap.cellToWorld functions and adapters for Tilemap, RuleTile. That powers 5 capabilities the agent reaches through rql-query / rql-mutate.

- Create tilemaps — Create a Grid with a Tilemap and set its orientation, anchor and other settings. RQL: `tilemap | call CreateTilemap("Ground")`
- Paint & fill tiles — Set single tiles or lists of cells, box-fill or flood-fill areas, and clear a box or the whole map. RQL: `objects | get components | where $ is Tilemap | call BoxFill("Assets/Tiles/Grass.asset", -5, -3, 5, 3)`
- Read cells — Look up the tile in a cell, list used tiles and painted cells, count tiles, and convert between world and cell positions. RQL: `objects | get components | where $ is Tilemap | select $ref gameObject.name tileCount usedTiles cellBounds orientation`
- Per-cell colour, rotation & colliders — Tint, rotate or flip individual cells and set each cell’s collider type. RQL: `objects | get components | where $ is Tilemap | call SetColor("(0, 0, 0)", "#FF8080")`
- Tile & rule-tile assets — Create Tile assets from sprites and RuleTiles, then add rules to them. RQL: `tilemap | call CreateTile("Assets/Tiles/Grass.asset", "Assets/Art/grass.png")`

## Install

Requires the base plugin com.ivanmurzak.unity.mcp. After installing, the RQL module loads with the package — the agent sees it in rql-schema.

```bash
openupm add com.ivanmurzak.unity.mcp.tilemap
```

## When to ask the AI for it

Ask for 2D level layout — paint a platform, box-fill a room, build a rule-tile.

Not sure if it's installed? Ask the agent to run rql-schema — the tilemap source only exists when the package is present.

## Example prompts

1. Create a Grid with a Tilemap, then box-fill a 10×3 floor of the `Ground` tile.
2. Clear the tiles in the rectangle from (0,0) to (5,5) on the active Tilemap.

---

Source (HTML): https://ai-game.dev/docs/extensions/unity/tilemap
