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:

  1. Open the “TestProject.zip“ project
  2. Open the “SampleScene“
  3. Open “Edit → Project Settings → Tags and Layers“
  4. Expand “Sorting Layers“ and observe the order
  5. Select “Grid → Walls” GameObject in the Hierarchy
  6. 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

  1. 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

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.