Search Issue Tracker
By Design
Votes
0
Found in
6000.0.63f1
6000.2.14f1
6000.3.0f1
6000.4.0a5
6000.5.0a2
Issue ID
UUM-128453
Regression
No
Sorting layers work in opposite order
How to reproduce:
- Open the “TestProject.zip“ project
- Open the “SampleScene“
- Open “Edit → Project Settings → Tags and Layers“
- Expand “Sorting Layers“ and observe the order
- Select “Grid → Walls” GameObject in the Hierarchy
- Observe the Scene view or Game view
Actual result: “Walls” tiles are rendered in front of “Ground“ tiles
Expected result: “Ground“ tiles are rendered in front of “Walls“ tiles
Reproducible in: 2023.1.0a1, 6000.0.63f1, 6000.2.14f1, 6000.3.0f1, 6000.4.0a5, 6000.5.0a2
Reproduced on: Windows 11 Pro (24H2)
Not reproduced on: No other environment tested
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
The behaviour of the Sorting Layers is correct in both the editor and in the documentation.
The documentation states that:
You can group GameObjects into layers in their SpriteRenderer component. This is called the SortingLayer. The sorting order decides what priority each GameObject has to the Renderer within each Sorting Layer. The lower the number you give it, the further back the GameObject appears. The higher the number, the closer the GameObject looks to the Camera.
In the editor with the test project, under Project Settings > Tags and Layers > Sorting Layers, the Sorting Layers are defined as:
Layer 0: Default
Layer 1: Walls
Layer 2: Ground
As per the documentation, Walls will be rendered before Ground, as Walls is on Layer 1 which is a lower number compared to Ground on Layer 2. From the Sorting Layers as defined, renderers will rendered in the following order: Default > Walls > Ground.
If you would like Ground to be rendered before Walls, you change the order of Ground such that it comes before Walls and is lower than Walls, for example:
Layer 0: Default
Layer 1: Ground
Layer 2: Walls