Line Renderer And 2d Isometric Sorting

Hey everyone! Quick question: did someone already succeed to have part of a line renderer be drawn in front of an object, and the other part behind…?

Here is a concrete example in the image below: the left hand side of the image shows what is happening today, and the right hand side, what I want.

What happens now is that the whole line is first drawn on top (as pictured above, on the left) and then suddenly drawn behind (not shown here), when its pivot’s Y position (center of mass) is greater than the object’s Y position. The only hack I’d see for now, is to split the obstacle in two sprites: the upper part that would always be drawn on top of the line, and the bottom part that would always be drawn behind.

Do you know if it is the only way, or if there’s a cleaner way to achieve this? Thanks!

Either use a mask or divide the column into 2 parts. Slicing the column right above the green bar seems like a good bet.

Thanks Beanie. Yep, I’ll probably go with slicing my sprites into 2 parts… until maybe one day the Unity team allows sorting line edges individually, according to their Y position :slight_smile: