I'm using Godot 4.4.1 and currently learning how to build auto dungeon generator. The dungeon "room" is developed using TileMapLayer.
Room parent are set to ColorRect for background.
I use this snipped in dungeon generator code to spawn new room:
func draw_map():
for x in range(grid_size_x * 2):
for y in range(grid_size_y * 2):
if rooms[x][y] == null:
continue
var room = rooms[x][y]
var draw_pos = Vector2(room["grid_pos"].x, room["grid_pos"].y) * room_dimension
var instance = room_scene.instantiate()
instance.position = draw_pos
instance.doorTop = room["doorTop"]
instance.doorBottom = room["doorBottom"]
instance.doorLeft = room["doorLeft"]
instance.doorRight = room["doorRight"]
map_root.add_child(instance)
As written in the instance.position = draw_pos line, the spawned rooms are then moved to their appropriate location. However, as seen in screenshots below, only ColorRect is moved.


tilemaptag. I'm not reputable enough to createtilemaplayertag. \$\endgroup\$