In this video you will learn how to generate a procedurally generated random endless race track constructed from square prefab segments which connect to one another and don’t overlap. The example game is a small endless runner game made with Unity.
You can download the full project code on Github here: http://bit.ly/endlessracer
Source