Infinite Terrain

Hello,am making a game like temple run and i am facing a proplem with the terrain…into making it an infinite survival terrain…as so it wouldnt end and it would have twists and so on…

You can create smaller terrain prefabs that you patch together as the runner moves. You just need to instantiate them and move them to the edge of the previous terrain. If they’re all, say, 100x100, then it’s easy to know where to move the new instance. You’ll also want to keep track of your instances and destroy old ones as the runner moves out of range.

Using this method to procedurally put together the terrain, you can get creative when choosing which terrain pieces to tack onto the end, such as choosing harder terrains if the player is doing really well, and easier pieces if the player keeps dying. If you want to design it beforehand, you can store a very compact 2D array of integers that identify which terrain piece goes in each quadrant.