unity runtime_error ai_generated true

ArgumentException:TilemapRenderer 不支持多个排序层。仅使用第一个排序层。

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

ID: unity/tilemap-rendering-corruption

其他格式: JSON · Markdown 中文 · English
90%修复率
80%置信度
1证据数
2024-01-22首次发现

版本兼容性

版本状态引入弃用备注
2021.3.32f1 active
2022.3.15f1 active

根因分析

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

English

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

generic

官方文档

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

解决方案

  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.

无效尝试

常见但无效的做法:

  1. 95% 失败

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

  2. 70% 失败

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

  3. 50% 失败

    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.