UI Draw Order Issue

Hi guys!

I’m trying to make a 3D carousel but I have an issue with the draw order.
So basically, I have a Canvas which mode is set to Screen Space - Camera and my Camera is in perspective mode. I change dynamically the sibling index so the object I want on the top is always at the last sibling Index.

Here is a screenshot of my problem
[38735-draw+order+issue+2.png|38735]

Any ideas ?

It works with classic sprites but I really want this to work with the UI system!

Cheers

on your canvas there is a option for how things are layed out on your screen you have screen space - overlay, screenspace - camera and world space I think that will fix your issue I haven't needed anything more than over lay so I can't be sure wich one to tell ya to use but overlay places everything to the front then it becomes a order in your Hierarchy that determines its position.

Yes, thanks, but Has I'm trying to make a 3D carousel, I need perspective (I'm moving the objects along the z axis)

I think you would use the world view and that should allow them to be positioned as they are in 3d space

No, I need the Screen Space - Camera. I need this to be scaled as UI. As I use posZ, I can't use Sceen Space Overlay

1 Answer

1

Ok I found the solution.
I was using the Canvas overrideSorting property that throw a lot of errors.
To solve it, the sortingOrder value must be >= to the Canvas parent sortingOrder value.