Search Issue Tracker

Fixed in 2018.2.X

Fixed in 2017.3.X, 2017.4.X, 2018.1.X

Votes

0

Found in

2017.3.0f1

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

-

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. 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. 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).

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.