- Home /
Highest sibling but though not visually not on top
Hi guys, i dont know if i understood the sibling system wrong but i thought that the highest silbing is always on top of the other childs also visually. I have a custom Drag and Drop system with Dropzones as parents. Now i want to set the last draged always on top of the other obejcts visually. And when i drag them they should be on top of basically everything in the game. I do that with transform.SetAsFirstSibling and they also are the first one in the hierachy then but not visually. How can i do that? Thanks a lot
Actually it is reversed, sibling that is at the bottom of the hierarchy is visible over other siblings. At least that's how it works on UI
Answer by Vicarian · Sep 04, 2018 at 08:06 PM
Last sibling has the highest Z-index by default, unless you override it.
shamed But i tried it with that change and it changes the order correctly but again no visual change.
It's probably my lack of understanding of the quirks of 2D Unity. I work exclusively in 3D. I'll have a look at a test project when I get home.
$$anonymous$$aybe it is because i use Sprites not UI object. $$anonymous$$aybe i need to use the sprite sorting layer. I will play around with that.
Answer by misher · Sep 05, 2018 at 09:07 AM
In order for your sibling to render on top, you should make it last sibling:
transform.SetAsLastSibling();
Vicarian already mentioned that but the problem is that i need to use the Sprite Layers ins$$anonymous$$d.
Your answer
![](https://koobas.hobune.stream/wayback/20220612174048im_/https://answers.unity.com/themes/thub/images/avi.jpg)