How to generate endless terrain like SWERVE

I am trying to develop similar game like SWERVE. I have created endless road using pool of five models (Road, Road Small, Road Tiny, Corner and Checkpoint). My script for car also working fine. I am only stuck on terrain.

I really don’t know what should be logic for endless terrain here, because road is not straight. What should be size of each terrain block?

Or first I create terrain and then that terrain generate road?

I am puzzled here, looking for a hint.


SWERVE game link

Hi @shukerullah and welcome!

You can find great information regarding infinite runners in this post:


A bit more info on how I tackled it:

1 Like

@LeXXik Hi, did you remove this video? I am unable to play.

I tacked by creating a 6x6 grid of blocks. Each block has a script which compares its location with player and when distance between block and player is greater than half of grid size + block size then I move block to new location which in front of a player.

Hmm, seems the forum auto-formatted the embedded player. I’ve edited original post to have it as a simple link to the video. Should work.

1 Like