How to quickly set (copy and past?) tilemap terrain?

Thanks for your answers! I managed to solve my problems thanks to your help.

I have a last question (sorry haha) regarding the way I’m supposed to change a tile color. Ideally, I would like to do it in code, and without having to use multiple tileset (for example I’d like to put some tiles in an array and color all of them, at runtime, by changing every tile’s modulation).
I found an old topic on the forum where they mention a method called tile_map.tile_set.tile_set_modulate(id, color): How to change tileset color using code - #2 by system

I searched on the documentation and it seems to be gone, but I searched in the tileset doc and also the tilemap doc (using ‘modulate’ keyword) and I have not found a new way to do that: changing a tile’s color in code at runtime. Which is weird because it seems to be possible in previous versions of Godot, but also because the Godot 4 tilemap’s documentation stipulates that “using set_layer_modulate() will be multiplied by tile’s color and TileMap’s modulate.”, so apparently there is a tile color (unless it means the color of the texture itself I guess).
The only think I found in this very page is the set_layer_modulate() function, but it seems to change the all layer modulate (the same way I managed to do it in the editor). I guess it’s ok and I could get away with it by creating multiple tileset sources, like you advised me to do, but I just wanted to be sure there currently is no way to change a single tile’s color/modulate.

Again, thanks for yor help! It solved all my problems, appreciate it a lot.

1 Like