How do you change the modulate of a tile in a tileset via script?

Godot Version

Godot_v4.5.1-stable_win64

Question

How do you change the modulate of a tile in the tileset at a specific atlas (like for example Vector2i(2,0) ) via script, because tile_set_modulate() doesn’t exist anymore.
I want it to modulate all instances of that tile, not just a single tile.

You have to get the

TileSetAtlasSource

from the TileSet and then get the the

TileData which has a modulate-property

tile_set.get_source(0).get_tile_data(Vector2i(0, 0)).modulate = Color(1, 1, 1, 1)

Get TileSetSource object via TileSet.get_source(). Then get TileData object from the source object via get_tile_data(). TileData has the modulate property which you can set.