Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2020.2.0b9
2021.1
Issue ID
1290945
Regression
No
UI Image is not rendered in Prefab Mode when it is created under the GO who has GridLayoutGroup
How to reproduce:
1. Create a new Project
2. Create UI Canvas
3. Create a new GameObject and attach GridLayoutGroup component to it
4. Create a UI image as a child to the new GameObject
5. Drag the UI Image GameObject to the project view to make it prefab
6. Open the newly created Prefab and observe
Expected Behavior: Image is rendered in the prefab mode
Actual Behavior: Image is not rendered
Reproducible with: 2018.4.29f1, 2021.1.0a5
Note:
- Video attached ("FhtPtcKBTo.mp4")
- Other image prefabs are rendered as expected, only those created on GameObject with GridLayoutGroup are affected
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
- Usage of Adaptive Probe Volumes throws a lot of IndexOutOfRangeException and Assertion Failed errors
- Prefab overrides don't recover missing managed references
- Trail Renderer visual doesn't match the positions of vertices when they have been offset
- [Mobile] The Material is not visible when using the Decal Renderer Feature
- Uncaught TypeError: Cannot read properties of undefined is thrown when the tab is inactive for several minutes
Resolution Note:
As can be seen in the video, the image that is not visible in Prefab Mode has a width and height of 0. The image that is visible has a width and height of 100.
The first image gets a width and height of 0 because it's made into a Prefab at a time while it's being driven. And driven properties in RectTransforms have serialized values of 0. You can set the width and height in Prefab Mode to whatever size you think it should have when it's not driven.