It doesn’t make much sense to create a tilemap of infinite size. I would suggest that you use a number of smaller tilemaps as the segments/chunks of the map nearest the player and update those as the player moves around on the map. I have an example similar to this here: publicexamples/examples/infinite_map at master · britzl/publicexamples · GitHub