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
- [CI/CD]Build cache not invalidated when building targets with different defines
- VFX Learning Templates contains an empty folder the HDRP_VFX_Learning_Templates Scene
- Crash on -[NSApplication endModalSession:] when changing code in a Code Editor, saving and clicking on the Unity Window with "Stop Playing and Recompile" selected
- “Install package from git URL” and “Install package by name” tab does not close when resizing undocked Package Manager window and gets pushed outside the window
- "EndLayoutGroup: BeginLayoutGroup must be called first." errors are thrown when creating a Tag with identical name and holding the enter keyboard button
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.