Hi!
I’m creating a Flappy Bird game on Unity2D. I added a background and some pipes. when i press the “play” button, the pipes are supposed to move to the left so that the player can pass between but we can’t see the pipes because they go under the background. i would like the pipes to go above the background but i don’t know how to do it.
thanks you for your help !
Have a good day
Hi there!
It sounds like the issue is related to sorting order in Unity’s 2D renderer. You can fix this by adjusting the sorting layers or order in layer for your background and pipes.
Here’s how to do it:
- Select the Pipes in the Hierarchy window.
- In the Inspector, find the Sprite Renderer component for your pipes.
- Look for the Sorting Layer and Order in Layer settings.
- Make sure that the Sorting Layer for your pipes is above the background (for example, you could have a “Background” layer and a “Foreground” layer for the pipes).
- If the Order in Layer for your pipes is smaller than the background, increase it. For example, set the pipes’ Order in Layer to 1 and the background to 0 (or any higher number for the pipes).
This will ensure that the pipes render above the background as they move.
Have a great day.
That works! Thanks you so much!
Have a nice day !
Happy that it worked!
Happy developing.