Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 1.09 KB

README_ENG.md

File metadata and controls

16 lines (10 loc) · 1.09 KB

Unity Parallax

Script for creating 2d infinite scrolling background in Unity with parallax effect from the article.

Usage

All magic in the script ParallaxScript.cs.

First you need to add 3 copies of background with offset. Create gameobjects

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.

Backgrounds offset

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.

Фон с параллакс эфектом