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
- Vector3 node has no X, Y, Z outputs when adding Vector3 node in the Visual Effect Graph
- [Android] Error "Blitter is already initialized" is present when Adaptive Probe Volumes are used with OpenGLES3
- VFX Graph effect instance stops rendering when a second instance of the same effect starts 2 frames later
- Operations on the Color32 array are not reflected in WebGL Player when HDR is off
- Rigidbody moves away from the original GameObject when Center of Mass is set in every frame
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.