A parallax system created to speed up parallax effects implementation in Unity projects.
- Open the Package Manager window
- Click on the "plus" sign
- Select "Add package from git URL"
- Paste this repo's SSH link (git@github.com:PixelRubro/ParallaxerSystemForUnity.git)
Add the following line to your manifest.json
found in the "Packages" folder
"com.pixelrubro.parallaxersystemforunity": "git@github.com:PixelRubro/ParallaxerSystemForUnity.git"
The main tool in this asset is the ParallaxExpansibleElement, which will move copies of itself around while following the camera at a relative speed set by the player.
In this case, the first step taken is to create copies of the element:
Those copies will be then moved around if the camera attempts to exit the area covered with the copies:
There's also a moving element, the ParallaxMovingElement, which moves to direction with a speed, while also following the camera movement.
This element is also able to respawn itself at the opposite side of the screen as soon as its movement takes it outside of the view:
The last element of this list is the static element, the ParallaxStaticElement, which will keep following the target camera with no offset:
- First, create an object which will parent all the parallax elements and add a ParallaxManager component to it
- Then, add your parallax elements as children of the ParallaxManager object, setting the sprites sorting orders accordingly
- Set the speed of each parallax element as you wish
- That's it! No additional coding needed!
If you still have doubts, check the demo scene in the "Samples" folder.
This is a limitation known by the Unity team. Until they look at it, you will have to drag the scene file into somewhere in your "Assets" folder.
Graphic assets made by Kenney: