how to disable Transparency Sort Axis in UI canvas?

I using Transparency Sort Axis for my top down game (i want only sprite object) but I don’t want set Transparency Sort Axis in layer UI

So you know, this isn’t the UI forum. The UI forum is here if you are asking specific questions and UGUI, Canvas, RecTransform etc.

I’m sorry! This is my first time

Not a problem! Just wanted you to be aware of where the UI devs live! :slight_smile:

The thing you are asking doesn’t add up. Canvas objects don’t use sorting axis so there is nothing to disable. Canvas objects are sorted based on the child order in transform tree. Also you shouldn’t put sprites in canvas. In canvas you should use Image component, use Sprite(Renderer) only for non canvas objects.

There are two different things you can do:

I recommend creating your UI with Canvas using proper UI components. Which shouldn’t be affected by sorting axis. There are also two different TextMeshPro components one for canvas and other for non canvas usage, use correct one matching to your setup.

If you really want to create your UI using non UI components like Sprite, then you shouldn’t use canvas and place your UI elements in separate sorting layer. When sorting 2d objects sorting layers (and sorting order property) have higher priority than sorting axes. So if you have properly setup the sorting layers and order to get desired drawing order, it shouldn’t matter whether sorting axis get applied or not. Note “sorting layer” an “layer” are two completely different unity features.“Sorting order” property and the order of children in transform tree are also two different things.

1 Like