- Home /
how does UI/Canvas Draw order work?
Ok, here's my setup
The blue menu with the white border, is the entireity of StatsPanelCanvas. What i want is for it to always draw BEHIND StatsButton, which is just below it in the child list.
As far as i understand, child objects are drawn in their order, so the last child should always be on top of everything, and the first should always be underneath everything. But that's not so, if i move the stats button down:
Ok so clearly i must be wrong, lets try moving StatsButton above the StatsPanelCanvas
That works, great! . Let's start play mode now, and see it in action. During playmode, the StatsPanelCanvas gets moved around and transformed a lot.
So what's going on here then?
But if i now, while still in play mode, swap their order again;
I have no idea what is going on here. Someone please explain this to me. How can i make the stats button ALWAYS be on top?
the strange one is when you not play your game. the UI draw order is always drawn first from top to bottom on Hierarchy.
Are those screenshots all from the "Game" tab? In the scene view, I don't think the render order is as well defined.
first 3 are scene, last 2 are game. i would assume there isn't a difference
Answer by Hanuschi · Oct 18, 2016 at 07:41 AM
Hi, I have exactly the same problem (U 5.4.1f1 Personal) now and I cannot figured out why neither object ordering nor override sorting ordering does not work as I expected. Has anyone found a solution?
Your answer
Follow this Question
Related Questions
Issues rotating a UI image while the canvas is parented to the Main Camera 0 Answers
I Have a Button in Canvas, i Click anywhere except the button and it gets clicked 0 Answers
Basic question about creating a menu 1 Answer
How can I reference a Toggle? 3 Answers
button OnClick function triggering another buttons OnClick 0 Answers