Create Tile with TileMap

Is there a way to use tilemap and create tiles right at the mouse cursor in the scene? I only see actions to change tiles and delete tiles but not create

I don’t believe you can. I think all of the tiles need to be created in the editor. Although, you can change the number of tiles in the row and columns. The last time I tried doing that, it didn’t work. But it does seem to work now.

You can add a tilemap at runtime and then set the number of columns and rows at runtime.

Otherwise, you need to create at least one tile in the top-left and bottom-right to define the overall size. It doesn’t need to be a visible tile, they could be transparent images. Or you could start with a complete background.

To add tilemaps at runtime, you can also draw tilemaps inside an external layout or I guess a prefab object. Then just add them at runtime.

It wouldn’t hurt to add a suggestion. A problem would be that adding tiles above or to the left of an existing tilemap would alter the row and column of existing tiles.The tile at 5,5 might become 10,10 unless the new tile locations used negative row and column locations.

2 Likes