How can I create an endless line in a 2d side scroll game?

Hello I am new in Unity and i don’t really know a lot about programming. My first Project I want to do is an 2d endless runner.
So can someone explain me how i can do a simple endless line which gets destroyed if it gets out of the display on the left side and the line gets generated on the right side of the display, so it seams like its an endless line. The line should be only straight and without gaps. ( The line should be a long black cube). Hope someone can explain my how it works.
Thanks in advance.

You could just have a long black cube parented to the camera in just the right position. This would cause it to follow your player around.

If there’s any problems with that: You’re going to have to have two blocks, one the player stands on and the other directly ahead of the other.
When the player reaches the second block, move the first one ahead.