Unity Mobile Game — Scene Setup

Create some Perspective Parallax and Setup our Player in Unity

Objective: Go over how I achieved perspective parallax and how I set up my player for my 2D mobile game in Unity.

Perspective Parallax

In order to achieve perspective parallax, the first thing you need to do is make sure you have a scene with varying layers to them. For example, in my project, I have three (3) different layers — foreground, background, and far_background.

Now, to achieve the perspective parallax, it will help if you have your layers Z-Transform component at different values. For example, on my background layer, the z for my Transform is set to 1, and the z for the Transform on my far_background is set to 3. With all that, make sure your camera has its Projection set to Perspective. This will give you a result similar to what I have shown here:

Player Setup

To get the player setup, the first thing I did was slice all of the sprites necessary to create the animations for our player.

Once I got that done, I pulled in the first frame of my player idle sprite and made it a child of an empty GameObject named Player

With this, I now have a player in my environment I can do manipulate and do cool things with.

With that, we have our scene set up as we move forward with development. In the next article, I will be going over my implementation for player movement.