Search Issue Tracker

By Design

Votes

4

Found in

2021.2.0a7

2021.2.2f1

2022.1

Issue ID

1381855

Regression

No

Identifier uniqueness violation, Sprite Renderer loses Sprite property when using TextureImporter.spritesheet

2D

-

Reproduction steps:
1. Open the user's attached project
2. Reimport the "fruits_sheet" in Assets/Sprites
3. Right-click the "fruits_sheet" and select "Split (4 sprites)"
4. Observe warning in the Console window
5. Drag and drop the orange and the crate Sprites into the Scene
6. Enter Play mode

Expected result: Both the orange and the crate are visible in the Game view
Actual result: An "Identifier uniqueness violation" warning appears in the Console, the crate loses its Sprite under Sprite Renderer. Full warning:
Identifier uniqueness violation: 'Name:sprite-3, Type:Sprite, FileId:0'. Multiple Objects with the same FileId are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.

Reproducible with: 2021.2.0a7, 2021.2.5f1, 2022.1.0b2
Not reproducible with: 2019.4.33f1, 2020.3.25f1, 2021.2.0a6

  1. Resolution Note:

    When creating Sprite Rects via a tool, the data provider interfaces (https://docs.unity3d.com/Packages/com.unity.2d.sprite@1.0/api/UnityEditor.U2D.Sprites.ISpriteEditorDataProvider.html) should be used, rather than changing the Sprite Rect data directly inside the TextureImporter itself. For an example on how to use the data provider interfaces, see the following forum post: https://forum.unity.com/threads/how-to-change-individual-spritesheet-in-textureimporter-object-without-regenerating-all-spriteids.631252/#post-7381619

Comments (1)

  1. Masterio

    Dec 22, 2021 20:40

    Whole Project stoppped ...

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.