I have a TileMap in my Scene which I store in a variable and then remove from the scene tree with "remove_child".
I then create a Thread to fill the tilemap with a large number of cells to create my world.
When the thread finishes, I add the TileMap back into the scene with "add_child", but this causes the game to freeze for several seconds.
Is there any way to avoid this lag but still be able to use a Thread to fill the TileMap? Since you can't access the scene tree from a Thread I don't see how...