So I am doing a map generator, when the player reaches certain x position a tilemap is loaded and another is distroyed I use the following code to do this:
total_distance = total_distance + 1024
var new_tile = TileMap1.instance()
new_tile.position.x = total_distance
#Here I add the instance to the tree
var arreglo = tiles.pop_front()
#Here I remove the node
For some reason the games slowdown, I read into object pooling but some dev a time ago said that was not necessary in godot so I dont know what to do.