Reproduction steps:
1. Open the attached “IN-97464.zip” project
2. Open the “SampleScene”
3. Select the “SubCanvas2” GameObject from the Hierarchy (Canvas Sorting Test > Canvas > SubCanvas2)
4. In the Inspector in the Canvas Component disable the “Override Sorting” property
5. Re-enable the “Override Sorting” property
6. Observe that “SubCanvas2” GameObject is sorted in front
7. Perform 3-5th steps with the “SubCanvas1” GameObject
8. Observe the Game View
Expected result: “SubCanvas2” GameObject (red square) is sorted in front of “SubCanvas1” GameObject
Actual result: “SubCanvas2” GameObject is sorted behind “SubCanvas1” GameObject
Reproducible with: 2022.2.0a9, 2022.3.60f1, 6000.0.43f1, 6000.1.0b11, 6000.2.0a7
Not reproducible with: 2022.2.0a8
Reproducible on: Windows 11, macOS 12.5 (M1 Max)
Not reproducible on: no other environment tested
Notes:
- All Canvases have the same value “Order in Layer” - 0, but the “SubCanvas2” position closer on the Z axis
- Disabling and re-enabling Canvas GameObjects also show the same behavior as modifying the “Override Sorting” property