Search Issue Tracker

Won't Fix

Votes

0

Found in

2019.2.0b1

2019.2.0b3

2019.3.0a3

Issue ID

1158131

Regression

No

Rect Transform size and anchors inside of prefab instances are zeroed out when PrefabAspectRatioFitter is disabled in the prefab

Scene Management

-

How to reproduce:
1. Open the attached project "AspectRatioFitter.zip" and scene "SampleScene"
2. Open the prefab "Inner"
3. Disable the "Innermost" Game Object's AspectRatioFitter Component
4. Save the "Inner" prefab
5. Observe the instances of "Inner" inside of the "Outermost (1)" Game Object in the scene

Expected result: the red square GameObjects named "Innermost" inside of "Outermost(1)" remain the same as they did before saving the prefab
Actual result: the red square GameObjects named "Innermost" inside of "Outermost (1)" disappear from view (their size and anchor values becomes zero)

Reproducible with: 2019.2.0b4, 2019.3.0a4
Could not test with: 2019.2.0a14, 2019.3.0a2 (UI Element components have missing scripts)

  1. Resolution Note:

    There is a complex interplay between the way driven properties work and the way Prefab overrides work which makes this issue a logical consequence of the systems (even if it's not intuitive), and unfortunately it is prohibitively impractical to fix.

    The anchors are zero because they have been overridden on the "Innermost" object inside the "Outermost" Prefab. Workaround (after performaing repro steps):

    1. Open "Outermost" Prefab.
    2. Expand each of the "Inner" objects and on each of the "Innermost" object, use the RectTransform context menu and choose "Modified Component > Revert".

    The issue is now resolved and the red Innermost shapes look correct both inside the "Outermost" Prefab and in the "SampleScene" scene.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.