Infinite Platformer - Using TileMap to create an infinite level?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Thomas Crammy

Hi, I’m fairly new to Godot.
I’ve been using the TileMap to create platformer levels.

I was wondering how I can generate tiles to be placed in the scene so that the level would be infinite. How do I create a script to spawn in the tiles?

EDIT: After some scouring I found set_cell() function for tilemaps… do I use that?

:bust_in_silhouette: Reply From: Sween123

Attach a script to the tilemap
Iterate every objects you put in the tilemap using for loop and save their info in an array, or dictionary, or anything you want.
Is the player always running forward? If so, just simply generating new objects from the infos you saved and removing the ovjects you have passed.