Script for creating 2d infinite scrolling background in Unity with parallax effect from the article.
All magic in the script ParallaxScript.cs.
First you need to add 3 copies of background with offset.
Nested objects should have offset by X axes. One with negative offset and one with positive. As a result root element will be in the middle, and 2 nested elements on the sides.
Now you just need to add ParallaxScript.cs to the root element and add ref to the camera in the Editor. And the result will look like this.