Sprite sorting order, background behind middleground but in front of foreground
Ive got 3 layers A "foreground" a "middleground" and a "background" I want the backround to be drawn on top of the foreground but still behind the middleground. I also want the foreground infront of the middleground. How would I go about doing this? I hope you understand my question :P
Answer by tanoshimi · Oct 20, 2016 at 06:17 PM
You've described a logical impossibility:
B > F
B < M
F > M
Yes, of course I have.. but Im not trying to just enter a magic number into the sprite sorting order box. Im trying to find another aproach, some sort of rendering trick
why would you want to draw the BAC$$anonymous$$ground in FRONT of the FOREground? That would make the background the foreground. This makes no sense.
You solve this by making more than 3 layers and put the stuff you want in a logical order where back = back and front = front
@b1gry4n Lest just call the layers 1, 2, 3 then :) I just said fore, middle and back to make it easier to understand. I understand now that it completly doesn't make sense. Can you please elaborato on : "You solve this by making more than 3 layers and put the stuff you want in a logical order where back = back and front = front"
You edit the images and cut them up into more images.
Say I have a "background" like this and I want the blurry tree/bushes in the foreground to appear in front of the middleground : http://bkgrounds.xyz/forest-sprite-backgrounds/xyIOWDBNcOhYIuJqfXG91d$$anonymous$$iX6UUYn7wWAptz2JrS1DJuT2x5nq$$anonymous$$vjm_cG4TxDN6ZJ1to5H1vQbR1DZmrid_3S$$anonymous$$6fXDjztE2xo7SHDusJtfg_b9jAQH-D5JD9DYF3XUd.jpg
I need to cut out the tree and bushes into its own image and make sure it now sits as the top most layer. Now I have 4 images.
Oh yes I know that, its not what Im asking for though
@b1gry4n Im asking how to put the background in front of the foreground but behind the middleground. The middleground should still be in front of the background
I understand now that it completly doesn't make sense.
@b1gry4n If you cant answer my question then why are you here arguing with me?
calling them background/foreground or 1,2,3 doesnt magically make it make sense. you have 3 pieces of paper stacked on top of eachother and youre trying to make the bottom most piece of paper appear in front of the top most piece while still being behind the middle piece. Thats the part that doesnt make sense.
So unless you make a custom shader to mask parts of these sprites or you use transparency in a clever way, this is impossible.
@b1gry4n Thanks for acually "kind of" answering my question "So unless you make a custom shader to mask parts of these sprites or you use transparency in a clever way, this is impossible"
Your answer
Follow this Question
Related Questions
Set the Sorting Layer for UI Controls 0 Answers
Halo hidden under the sprites 3 Answers
How Can I Make Sprite Sorting Layers 'Relative'? 1 Answer
Mixing sprite renderer and mesh renderer sorting layers 1 Answer
I'm a beginner , currently i have a problem with sorting order pragramatically . 0 Answers