Search Issue Tracker
By Design
Votes
0
Found in
2017.4.9f1
2019.1.0a1
2019.1.6f1
2019.2.0a1
2019.3.0a1
Issue ID
1164993
Regression
Yes
GameObject turns black when a Texture of an instantiated Sprite is used in the Material
How to reproduce:
1. Download and open the attached project "1164993.zip"
2. Select the Cube GameObject in the Hierarchy and inspect its Material
3. Start Play mode
4. Inspect the Cube GameObject's Material again
Expected result: Cube GameObject's Material remains unchanged
Actual result: Cube GameObject's Material turns black
Reproducible with: 2017.4.29f1, 2018.4.3f1, 2019.1.9f1, 2019.2.0b8, 2019.3.0a8
Notes:
Some Shaders will turn invisible instead of black (ex. Unlit/Transparent).
Sometimes the issue will not reproduce when changing Unity versions, reopening the project in the same Unity version twice will reproduce it.
To reproduce the issue in Unity versions earlier than 2018.3.14f1, the project will need to be reopened every time.
In Unity versions 2018.3.14f1 and above, the issue will reproduce every time the Play mode is started.
The affected Sprite's Texture needs to be added to a Sprite Atlas in order to reproduce the issue.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Inspector elements are rendered twice when the script component is added via drag-and-drop while the HideFlags.HideInInspector property is set
- Error "Light baking failed with error code 5 (Convergence data not available while rendering lightmaps)" thrown in Console when generating lighting for specific GameObjects
- Copy and Paste options for an Animation Property value are disabled in the Right click contextual menu
- Asset is not found when searching the Label "NewLabel" in Search Window
- "Compute dispatch: missing texture ID..." and "Compute dispatch: missing UAV ID..." warnings are thrown after changing the platform in High Definition 3D template
Resolution Note:
By design, Atlas textures are almost always bigger than the size of the sprites they pack. Hence the texture of a sprite will not match with texture of the packed atlas. Sprite-Renderers and Canvas-Renderers dynamically update their UVs when the Atlas is used.
For custom use-cases such as above, please do not use Sprite-Atlas. This is by design.