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
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
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.