Unity makes parallax easy!

Easy Parallax Scrolling in Unity

Valdarix Games
Nerd For Tech
3 min readJun 28, 2021

--

//Add some depth to your 2D game

Image by Video Game Animation Study

Let’s face it one of the two samples above looks better than the other. The scrolling effect that appears to be happening at different depts of field in the scene give the scene more of a feeling of vastness and make it feel more realistic compared to the flat 2D background of the other sample. The depth added by having multiple background layers give the game so much more life.

Parallax scrolling as it is known as has been a part of the video game industry since 1981’s Jump Bug used it to create a star field in the sky. Since then it has become one of the most identifying elements in a 2D game. But how do we pull of the effect?

Luckily Unity makes the effect really easy to accomplish using a couple of settings on the camera and the Z position in the transform of our background layers.

Camera Setup

On the main camera we need to adjust the following setting(s):

  • Projection: Perspective
  • Field of View: adjust this to show all of the layers in your level design.
  • and nothing else!

While you can play with the other settings this is all you need to get started with the perspective…

--

--

Valdarix Games
Nerd For Tech

Turning my passion for video games and software development experience into a focus on video game development.