How can i generate a running screen with different things in every level like in temple run. but i dont want it to be endless, every level there will be a end and the user can go to the next level ?
the code i have here is,
C#
public Transform[] prefabs;
public int tiles;
public void GenerateLevel() {
for(int t = 0; t < tiles; t++) {
GameObject go = Instantiate(prefabs[Random.Range(0, prefabs.Length)]) as GameObject;
}
}
but all if the prefabs, model are being in the same place, how can i make it to go on it own position so it connects from one to another, and also when it rotates how can i make it to attach the next model after rotation.







