Improve Background Realism and Immersion with a Parallax Effect
Objective: put a parallax effect for the farther tilemaps
We painted on tilemaps that should represent layers of landscapes at given distances from the camera or point of view. Bu all appears flat, 2D-ish. That is because we lack the parallax effect: in other words, if we move the camera, everything stays in place instead of shifting of a quantity dependent on the depth.
To achieve this effect, a few simple steps are needed.
First, you have to change the projection option in the main camera, from Orthographic to Perspective. You can then play with the camera z position and FOV to get the zoom level you like the most.
The next step would be to push the tilemaps farther along the z-axis. The farther the landscape should be, the higher the z value —compared to the others. There is no need to use huge numbers, I put 1 and 2, but maybe even smaller numbers will do the trick. In this way, being the tilemaps effectively pushed back, the parallax effect will be amplified.
This is the result. You can notice how the waterfall and the caves shift while moving the camera… think of how cool it could be with a large enough painted level!
If you liked it, clap to it! Check out my games or buy me a coffee: every kind of support is appreciated!!