How can I make Procedurally Generated Terrain in 2d?

So, I’m stuck on a part of a game I’ve been working on. So far I have a side scrolling 2D game where you have to fly through obstacles. But instead of instantiating blocks or objects like that that you have to avoid, i wanted to have a solid line on the top and bottom of the screen that fluctuates randomly. I’m not sure how to do this. Could anyone possibly help me out?

Thanks.

well the line would be an array of lines associate with joint points or vertices. You would move randomly in y their position, but the hardest part is to create collision.

Maybe you can try to put a mesh and then with a shader change the vertices buffer not the index buffer , and maybe if you put a mesh collider on the mesh it will work but I cannot promise.