How to "connect " prefabs?

Hello everyone
I’m trying to generate terrain in unity 2D. So far im using diamond square alghoritm that gives me positions of where block should be. The thing is, how to "connect " prefabs ? So far my result looks like this :


And i’d like to make it like one solid floor. Is this even possible to do using prefabs? Thanks for any advice :slight_smile:

Are you just trying to generate blocks that are random Y values but touch on the x axis?

i think so :smile:

What I did was create a sort of object queue using a List and I added a predefined number of the same object into this list. I then iterated through the list and positioned the pieces one after another using a predefined gap. Then, I wrote some recycling code that told the objects to reposition themselves when they were off screen to the other side of the screen. This created a sort of endless runner effect.

Here’s where I got a lot of my inspiration from: