Parallax
Overview
The Parallax extension gives ProCamera2D the ability to create the popular 2D effect. It’s achieved by having a camera per each parallax layer. Each layer camera only renders the elements contained in the correspondent Culling Mask. These cameras then move at different speeds to create the parallax effect. Using the parallax component editor you can add, remove and sort layers. The editor will take care of creating the cameras as needed and also adjust each camera rendering settings.
Considerations
- The layers should be ordered from back to front. Use the handles on the left to move them.
- The layers speed should be ascending. i.e a back layer should have a lower speed than the one in front.
- Layers with a speed lower than 1 means the layer elements will be rendered behind the Main Camera elements. Layers with a speed higher than 1 means the layer elements will be rendered in front of the Main Camera elements.
- The Culling Mask of each layer should be unique to avoid drawing the same elements on multiple cameras. The same applies to the Culling Mask of the Main Camera which you have to manually set. i.e. remember to disable the parallax layers from the Culling Mask of your Main Camera!
Editor
Parameters:
Parallax layers list
: Shows all parallax layersParallax X
: If enabled the camera will have parallax movement in the horizontal directionParallax Y
: If enabled the camera will have parallax movement in the vertical directionReset Offset
: This button resets the offset position to the current camera position used to calculate the parallax amount
Parallax Layer Parameters:
Camera
: The camera used to render this layer. The camera should be automatically created when adding a new parallax layer and this field should also be automatically populated. You don’t need to edit the camera settings manually, the editor will take care of that for youSpeed
: Represents the speed at which this layer should move in comparison to the main camera. A speed below 1 means the layer elements will be rendered behind the Main Camera elements. A speed higher than 1 means the layer elements will be rendered in front of the Main Camera elementsCulling Mask
: Represents the (Unity) layers that the layer camera should render