Search Issue Tracker

Fixed in Unity 2018.2

Votes

0

Found in

2017.3.0f3

Issue ID

988706

Regression

Yes

The AspectRatioFitter with envelope parent mode doesn't control the RectTransform at the first frame after changing the scene

Scripting

-

-

Priority: 2Necessary for shipping a final release

-

Severity: 3Secondary functionality broken

Reproduction steps:
1. Download project "AspectRatioFitterBug.zip" and open in Unity
2. Open Main scene
3. Enable Play mode

Expected: scene changes smoothly
Actual: scene experiences a glitch (appears at the end of the GIF)

Reproduced on: 2017.3.0f1; 2017.3.0p4; 2018.1.0b5; 2018.2.0a1
Not reproduced on: 2017.2.1p3; 2017.3.0a1; 2017.3.0b11
Regression introduced: 2017.3.0f1

Comments (2)

  1. F53bd3f72eb170db2eafccbd6407d58c?d=mm

    andersemil

    Sep 06, 2018 08:06

    A quick workaround for this issue on earlier Unity version is to do this in the first frame, which forces the component to update:

    foreach (var arf in gameObject.GetComponentsInChildren<AspectRatioFitter> ()) {
    var restore = arf.aspectRatio;
    arf.aspectRatio = arf.aspectRatio*1.001f;
    arf.aspectRatio = restore;
    }

  2. Ebfd7874eba05a9f22f7fa28d26e5b5b?d=mm

    chyrho

    Apr 19, 2018 04:34

    This particular issue appears to be fixed in 2017.3.1p4. However, there is still another closely related one:

    When SetActive(true) is called on a previously disabled canvas during a Update() or LateUpdate() event from another script, the RectTransform is not recalculated until next frame. The symptom is the same as this one (incorrect RectTransform dimension for one frame).

All about bugs

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