I’m working on a new endless runner example in Unity. Going for as simple of an engine as possible. The solution is to use quads for the foreground and background with repeating textures:
I created a little script that will take the quad and stretch it out to fill the screen and I can also control if it repeats horizontally or vertically which is how I did the floor.
Then I have another script which manages the speed at which I scroll the texture’s offset so it looks like the background is moving. I can also set the speed of the background and foreground to get a parallax scrolling effect like this:
With only a few lines of code and primitive 3d objects I’m able to achieve some impressive results!