unity runtime_error ai_generated true

ArgumentException: TilemapRenderer does not support multiple sorting layers. Only the first sorting layer will be used.

ID: unity/tilemap-rendering-corruption

Also available as: JSON · Markdown · 中文
90%Fix Rate
80%Confidence
1Evidence
2024-01-22First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2021.3.32f1 active
2022.3.15f1 active

Root Cause

TilemapRenderer component is assigned to a GameObject that belongs to multiple sorting layers, which is not allowed.

generic

中文

TilemapRenderer 组件被分配给属于多个排序层的游戏对象,这是不允许的。

Official Documentation

https://docs.unity3d.com/Manual/class-TilemapRenderer.html

Workarounds

  1. 95% success Ensure the Tilemap GameObject has only one sorting layer: remove any additional SortingGroup components or set them to None.
    Ensure the Tilemap GameObject has only one sorting layer: remove any additional SortingGroup components or set them to None.
  2. 88% success If using a parent SortingGroup, move the TilemapRenderer to a child GameObject and sort via the parent only.
    If using a parent SortingGroup, move the TilemapRenderer to a child GameObject and sort via the parent only.

中文步骤

  1. Ensure the Tilemap GameObject has only one sorting layer: remove any additional SortingGroup components or set them to None.
  2. If using a parent SortingGroup, move the TilemapRenderer to a child GameObject and sort via the parent only.

Dead Ends

Common approaches that don't work:

  1. 95% fail

    The sorting layer assignment is persistent in the scene; toggling doesn't change the actual sorting layers.

  2. 70% fail

    The new Tilemap inherits the same sorting layer settings from the TilemapRenderer preset; issue persists.

  3. 50% fail

    The error is about multiple sorting layers on the same GameObject, not the specific layer value; 'Default' may still conflict if another component sets a different layer.