Forum begins after the advertisement:
[General] How to create a background for a level like in Silksong? Parallax effect
Home › Forums › Video Game Tutorial Series › Creating a Metroidvania in Unity › [General] How to create a background for a level like in Silksong? Parallax effect
- This topic has 1 reply, 2 voices, and was last updated 1 week, 1 day ago by
Terence.
-
AuthorPosts
-
December 30, 2025 at 4:30 pm #19160::
I really like how the levels are made in silksong and their backgrounds. I have heard that the parallax effect was done by placing objects at different distances along the Z axis, that is, in 3D. I placed the sprites of the earth, bushes and rocks at z = 0. I shifted the physical block with the collider a little back, 0.1 further away from the camera along the z axis. I thought that I could just place layers at different distances and it would work like in silksong, there is a parallax effect, but due to the same level of “Order in Layer” in sprite renderer, objects nearby, such as floor sprites, start to flicker. As I understand it, for the Unity render, the “Order in Layer” is more important than the location on the Z axis.
the objects were blocked by my cube, which is the physical floor, although the cube is further away from the camera on the z axis, there are also bushes that are first on top of the stones, and if you walk the character sideways, they fade into the background. If you look at it in 3d mode, then on one side the stone overlaps the bush, and on the other side as well! The stone blocks the bush on both sides! They are at different z coordinates, even though they are close to each other.
I could assign an “Order in Layer” for each object, but is there any way to disable it? The Z-axis is enough for me and I would like the objects to be displayed according to their location on it, and not as additional layers. After all, if this is a floor consisting of many pieces, then each piece must have a different level than the levels of neighboring sprites in order to fix it.
Maybe I didn’t approach this issue correctly and my pipeline is incorrect and ineffective, but I’m still learning.
I would really like a lesson on creating a full-fledged location with a background, particles, parallax, postprocessing, and so on in the silksong style.
I uploaded the video with the problem to Google Drive.: https://drive.google.com/file/d/1HmZHb79qicH0lcvzsPuv2SqUi3iAW68u/view?usp=sharing
December 30, 2025 at 10:37 pm #19162::Hi avenom,
Normally, to deal with sorting layer issues, instead of manually assigning a Sort Order to each sprite, we will have 3 different layers:
- Foreground
- Midground
- Background
Each of the background objects will be assigned to one of these layers, and you won’t have to manually assign an Order in Layer to it. For objects in the same layer, you can let the Z-axis decide which one to go on top first, and manually assign an Order in Layer if some objects are flickering.
What you are doing is the right thing. I know you are asking to see if there is a trick to this, but there isn’t (not that I know of). The Sorting Layers can make your job easier, but that’s about it.
-
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: