How to change tileset color using code

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SpiderBro

Hi, I’m new to Godot and all I want is to change the color of a tileset.

the code is.

TileMap.modulate = Color( 1, 1, 1)

It clearly doesn’t work. so what can I do??

:bust_in_silhouette: Reply From: exuin

Modulating the tilemap will modulate all of the tiles. If that’s not what you want, you need to access the tileset.

So

tile_map.tile_set.tile_set_modulate(id, color)

where id is the id of the tile you want to modulate and color is the color.