This is a Godot addon for managing GridMaps through TileMapLayers!
A couple of example scenes are provided:
example/example_scene.tsn- Three GridMapLayers targeting one GridMap, creating a 3D island.
example/example_layer_baking.tscn- A single GridMapLayerBaker, showing how a tileset is configured and gridmap tiles are placed over it.
To get started you'll need a few things
- A TileSet resource. GridMapLayer saves the information for tile placement in the custom data layers.
- This only works with Atlas sources! And it assumes the atlas has no padding between tiles (currently!)
- A MeshLibrary. GridMapLayerBaker will use the ids to save to the TileSet.
- For a tileset with 1 subdivision (making it a 2x2 grid), you can get away with just four tiles! The same is true r any higher subdivision counts.
To utilize this addon, you'll need to first write data to your TileSet, so that GridMapLayers will know how to place them.
GridMapLayerBaker is the tool to write that data. It's a tool script built on top of GridMap and it renders a Sprite3D of your tileset to assist in placing the data.
- Create a new Scene and add a GridMapLayerBaker node (or set it as the root node)
- Set the Tile Set field to your TileSet
- Set the source ID to the source of the texture you want to create gridmap tiles for
- Optional: Set the tile subdivision (In our example's case, we want a 2x2 grid per tile, so 1 subdivision)
- Optional: Set the data layer name (using gml is fine if you're only planning on using one set if grid tiles per tileset)
- Set the Mesh Library. Make sure your cell cize matches the meshlibrary cells size.
- Start placing Grid Tiles over your tileset.
- When you're done you should have a representation of your 2D tileset in 3D gridmap form, along one layer.
- Press the
Save Data to TileSetbutton- This will write the tileset placement and orientations to each tile on the custom data layer named earlier.
- To make sure this worked properly, you can move your tiles off of the tileset using the copy tool in GridMap and erase the ones over the tileset. Press
Load Data from TileSetand they should reappear!
GridMapLayer inherits from TileMapLayer and handles the additional functionality of setting GridMapTiles.
- Set the data layer name that was used when baking the data
- Set the target GridMap (This is where GridMap tiles will be set)
- Set the target layer
- Set the tile subdivision (This should match what was used when baking the data)
- Draw your map like you would with any other TileMapLayer
- Press
Set GridMap Tilesto set the gridmap cells!- This won't clear the GridMap, you'll need to manage that manually through GridMap tools.
- Repeat this for any other layers to build a layered scene!






