Search Issue Tracker

Fixed

Fixed in 2020.3.47f1

Votes

0

Found in

2020.3.46f1

Issue ID

UUM-30749

Regression

No

Tilemaps are rendered incorrectly when rendering Tilemaps with the same Orders in Layers

--

-

How to reproduce:
1. Open the attached project “LayerOrderBug.zip“
2. Open Scene “SampleScene“ (Assets/Scenes)
3. Enter Play Mode
4. Press and hold middle mouse button to pan the camera to the yellow squares at the top right of the generated map
5. Zoom in with scroll wheel while wiggling the camera until the yellow squares are visible again

Expected result: There are no yellow squares when zooming in and moving the Camera
Actual result: There are yellow squares when zooming in and moving the Camera

Reproducible with: 2020.3.46f1
Not reproducible with: 2021.3.18f1, 2021.3.21f1, 2022.2.3f1, 2022.2.11f1, 2023.1.0a22, 2023.1.0b8, 2023.2.0a6
Fixed in: 2021.3.17f1, 2022.2.2f1, 2023.1.0a21

Reproduced on: macOS 13.0.1 (Intel), Windows 11 (by reporter)

Note:
- Reproducible in Builds
- At certain zoom out levels the yellow squares are expected (when zoomed out until only the “GroundLayer“ GameObject is active)
- Bug happens only at a specific zoom range (zooming in fully seems to eliminate the problem completely)
- The objects containing Tilemap Renderers of interest are called “WallBodyLeftStaticLayer” and “WallBodyRightStaticLayer”. These two are being used together to display one tile by displaying half of a tile each (left and right). Their sprites have 32px width whereas typical sprite has 64px width
- Unity seems to be picking one of the two Tilemap Renderers to display, despite the fact that they have no sprite overlap and have opposite anchors
- Bug seems to be related to the fact that both Tilemap Renderers have the same Order in Layer. Changing it switches which Tilemap Renderer experiences the bug
- Disabling the GroundLayer results in both left and right wall being shown correctly. This is very strange given Ground has order equal to 0 and walls have order equal to 1 (i.e. walls should be on top and not part of the same layer calculation)
- Moving the camera around implies behaviour in which screen is divided into square collections of tiles (chunks?) and some of them "become invisible" prematurely. Also moving the camera to contain less rocky/grey area fixes the issue implying the amount of tiles visible may be important
- Project graphics settings ensure only Y axis impacts rendering (Z is equal 0)
- Observed behaviour is similar to how a Tilemap Renderer in Chunk Mode treats sprites coming from multiple Textures. However in this case, all sprites are packed together in one Texture
- Setting a higher Order in Layer of the wall Tilemap Renderers makes the problem go away
- The Order in Layer value of the Chunk Mode renderers (WallBodyLeftStaticLayer and WallBodyRightStaticLayer) must be above Individual Mode renderers (WallBodyLeftActiveLayer and WallBodyRightActiveLayer) also makes the problem go away

  1. Resolution Note (fix version 2020.3.47f1):

    Fix for this issue is available on Unity 2020.3.47f1 and above

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.