gamedev-skills/awesome-gamedev-agent-skills/godot-tilemap
Claude Code and agent skill by gamedev-skills/awesome-gamedev-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Godot 4.7 tile maps with TileMapLayer and TileSet: atlas sources, data layers, terrain autotiling and set_cell or local_to_map at runtime. Use for 2D tile levels in Godot, tiles with no collision, a click on the wrong cell or porting a deprecated TileMap. Not for Unity (`unity-tilemap-2d`), tile art (`create-game-assets`) or generation (`procedural-gen`).
Install
npx vskill@latest install gamedev-skills/awesome-gamedev-agent-skills/godot-tilemapSKILL.md
The same SKILL.md was published earlier as gamedev-skills/awesome-gamedev-agent-skills/godot-tilemap.
Godot TileMap (4.7 TileMapLayer)
Author tile levels with TileMapLayer + TileSet, attach per-tile collision and data, autotile with terrains, and edit cells at runtime. Targets Godot 4.7, where TileMapLayer replaces the deprecated TileMap node (see Version notes).
When to use
- 2D levels on a tile grid, configuring a
TileSet(collision, navigation, custom data,
terrains), or reading/writing tiles from code.
- Migrating a
TileMapnode (one node, many layers) toTileMapLayernodes.
When *not* to use: moving the player across tiles → godot-2d-movement; general bodies and raycasts → godot-physics; generation algorithms → procedural-gen; level design practice → level-design; 3D grids → godot-3d-essentials (GridMap).
Core workflow
- One `TileMapLayer` per layer (background, walls, foreground), grouped under a
Node2D. All layers share one TileSet saved as an external .tres.
- Build the TileSet. The TileSet editor is click-only, so when you cannot drive the
editor, generate the .tres with a headless tool script (Pattern 1) and keep that script in the repo. Otherwise, ask the user to make the change in the editor and report the source id, atlas coordinates and layer names.
- Add data layers on the TileSet: physics layers (collision polygons plus their
collision layer/mask bits), navigation layers, occlusion, and typed custom data layers (damage: int, is_ladder: bool).
- Place tiles from code with
set_cell,set_cells_terrain_connector
set_cells_terrain_path. The cells in a .tscn are an encoded tile_map_data byte array, so never edit them by hand; write a generator script or ask the user to paint in the editor.
- Turn on per-layer collision/navigation with
collision_enabled/
navigation_enabled on each TileMapLayer.
- Check before you finish.
- Run the
godot-nodes-scenesskill'sscripts/check_godot_project.py <project-dir>
to catch a TileSet .tres whose texture or script path is broken.
- Prove the tiles behave with a headless test (Pattern 4): on a fresh checkout run
godot --headless --path . --import first so the tile texture is imported, then godot --headless --path . --script res://tests/test_tiles.gd, and read the exit code. With no Godot binary (godot, godot4 or $GODOT_BIN), ask the user to run it and paste the output. For a visual check, ask the user to run godot --path . --debug-collisions and report whether walls show shapes.
Patterns
1. Generate a TileSet .tres in code
Add the source to the TileSet before create_tile, so the tile's data knows the TileSet's physics and custom data layers. Polygon points are relative to the cell centre.
2. Mouse position to a cell, then read custom data
3. Place, erase and autotile at runtime
4. Headless test: a placed wall has collision and data
Gotchas
- `TileMap` node is deprecated since 4.3. Use one
TileMapLayerper layer. Old calls
with a leading layer argument (set_cell(layer, ...)) do not apply to TileMapLayer.
- `local_to_map` needs layer-local coordinates. Convert a world position with
to_local(...) first. A mouse event's position is in viewport pixels, so it breaks as soon as a Camera2D scrolls or zooms; use make_input_local(event) or get_local_mouse_position().
- `get_cell_tile_data` returns `null` for empty cells and non-atlas sources; check
before get_custom_data.
- Custom data is typed and named. Reading a layer name that doesn't exist errors;
define the layer on the TileSet first.
- "Cannot create tile. The tile is outside the texture..." → the atlas has no texture
yet, the coordinates fall outside it, or a tile already covers that space. Set texture and texture_region_size before create_tile.
- Terrains need every combination defined.
set_cells_terrain_connectplaces odd or
placeholder tiles when the TileSet's peering bits are incomplete.
- Runtime edits are batched to the end of the frame. Call
update_internals()only if
you must read updated internals immediately (expensive in loops).
- Collision not working? Check
collision_enabledon the layer, that the tile has a
polygon on a physics layer, and that the physics layer's bits match your bodies' masks.
References
- Read
references/tileset-and-terrains.mdwhen you need atlas vs scene-collection
sources, the per-tile data layer types, terrain set modes and painting, coordinate helpers, Y-sorting, runtime tile-data overrides, or the TileMap-to-TileMapLayer migration steps.
Related skills
godot-2d-movementfor characters that walk on these tiles.godot-physicsfor the collision layers/masks tile collisions take part in.procedural-genfor generating the cell layout.create-game-assetsfor drawing the tile sheet.level-design/roguelikefor design practice and grid-based genres.
Version notes
Last verified: 2026-11-11 against Godot 4.7.2-stable (released 2026-08-18).
TileMaphas been deprecated in favor ofTileMapLayersince 4.3.TileMapLayer.tile_map_datais stored as aPackedByteArrayin scenes.
Sources: TileMapLayer @ 4.7.2-stable, TileSet @ 4.7.2-stable, TileSetAtlasSource @ 4.7.2-stable, tile_map_layer.cpp @ 4.7.2-stable, Using TileMaps.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/godot/godot-tilemap/SKILL.md
Popularity
- Repository stars
- 8,984
- Repository forks
- 912
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gamedev-skills/awesome-gamedev-agent-skills/godot-tilemap)