How to make infinite 2d terrain in unity and fill it with infinite box colliders at random places?
I am creating a 2d Android game in Unity 5.3.4. I want to make an infinite terrain with some low poly clouds and mountains on the background. And i also i want to make random pits or holes on the terrain and fill it with box colliders. Can anyone please give me the script necessary for this?
My idea is this. I have a continuosly moving ball as my character. If the player touches anywhere on the screen, the ball will bounce(just like Flappy Bird). If the ball accidently fell into a pit which i told you earlier filled with box colliders, the game will be failed and it will restart.That's why i have to place box colliders on each pit. But it is not possible to place each collider on one pit one by one. So is there any way you can help me? Any help would be greatly appreciated.