Search Issue Tracker

Fixed in 4.6.4

Votes

2

Found in

5.0.0f2

Issue ID

673538

Regression

Yes

After instantiating canvas prefab with a slider or scrollbar, console displays modifications.empty() error

UI

-

How to reproduce in the attached project:
1. In FILE bar, use the Test Bug tab and press "Instantiate prefab bug"
or
2. Drag Slider Holder into the scene/Hierarchy

How to reproduce it in a new project:
1. Create a canvas prefab with a slider or scrollbar
2. Drag the prefab to Hierarchy or use PrefabUtilty.InstantiatePrefab(canvasPrefab)

Comments (15)

  1. Dc48185aafa579a514bd5fb6a07d234c?d=mm

    Zenvin

    Jun 24, 2018 07:36

    Happens to me in 2018.1.5f.1

  2. Eea90f4aa624835732226960fdbe991f?d=mm

    chasepettit

    Jul 20, 2017 03:42

    Still seeing this error in 5.6.1f1. Prankard's suggestion about disabling AspectRatioFitter did get rid of it for me.

    I didn't see any actual negative impact from it, but I guess it's nice to know where the error is coming from.

  3. Fb49fcac6d7c8fbe19b0cb41072f42ed?d=mm

    Ghosthowl

    May 16, 2017 06:15

    Still having this issue in 5.6.0f3

  4. Fe36c7f1a45e8ebb89114560892e1e28?d=mm

    Fritsl

    Feb 20, 2017 21:49

    Not fixed!!

  5. 808776177e42920462cf119af563fd65?d=mm

    prankard

    Aug 05, 2015 10:55

    So, I've had the bug recently in my project.
    And it happens when:
    Creating/Applying/DraggingDropping a prefab with the 'AspectRatioFitter' component in it.

    Which sucks, because I had a massive menu prefab, with a few of these in, I use them to help layout the 2d assets on multiple devices.

    Anyways, if people with this issue could try disabling the aspect ratio fitter on the component and let me know if it works.
    What I've done is disable all the aspect ratio fitters, and then in code. Enable them upon creation of the prefab.

    Here is a tiny editor script I wrote to help enable/disable and find all AspectRatioFitters and check how many aspect ratio fitters exists on a selection.

    using UnityEngine;
    using System.Collections;
    using UnityEditor;
    using UnityEngine.UI;

    public class EditorFix : MonoBehaviour
    {
    [MenuItem("Fix/Check All Aspect Ratio Fitter")]
    public static void Check()
    {
    GameObject activeGO = Selection.activeGameObject;
    AspectRatioFitter[] arfs = activeGO.GetComponentsInChildren<AspectRatioFitter>();
    int onCount = 0;
    int offCount = 0;
    foreach (AspectRatioFitter arf in arfs)
    {
    if (arf.enabled)
    onCount++;
    else
    offCount++;
    }
    if (onCount != 0 && offCount != 0)
    {
    foreach (AspectRatioFitter arf in arfs)
    {
    if (arf.enabled)
    Debug.Log("On : " + arf.gameObject.name);
    else
    Debug.Log("Off : " + arf.gameObject.name);
    }
    }
    Debug.Log("Aspect Ratio Fitters, On: " + onCount + ", Off: " + offCount);
    }

    [MenuItem("Fix/Turn On All Aspect Ratio Fitter")]
    public static void TurnOn()
    {
    TurnOnAspectRatios(true);
    }

    [MenuItem("Fix/Turn On Off Aspect Ratio Fitter")]
    public static void TurnOff()
    {
    TurnOnAspectRatios(false);
    }

    private static void TurnOnAspectRatios(bool on)
    {
    GameObject activeGO = Selection.activeGameObject;
    AspectRatioFitter[] arfs = activeGO.GetComponentsInChildren<AspectRatioFitter>();
    foreach (AspectRatioFitter arf in arfs)
    {
    arf.enabled = on;
    }
    Debug.Log("Turned " + (on ? "on" : "off") + " " + arfs.Length + " AspectRatioFitters");
    }
    }

  6. 001c47e9ff8c572a773f1a1685207b61?d=mm

    Mr B

    May 16, 2015 00:13

    Happened to me right now. If it is resolved, where is the solution?

  7. Cfc0b9e014ae8956493002c105abbe51?d=mm

    Kerihobo

    Apr 22, 2015 23:54

    "Voting disabled for resolved issues"

    This is NOT resolved. Still happens for me in 5.0.1f.

    I assume it's not damaging but it's annoying to see it in console everytime I drag UI prefab to scene.

  8. 6325f221fa39d6131f175f65e2684a27?d=mm

    Xarbrough

    Apr 14, 2015 21:39

    Still an issue in 5.0.1f1 :(

  9. Fb92c852295e493859447aa87b40062b?d=mm

    Braineeee

    Apr 09, 2015 21:24

    Nevermind. Just reported the bug using the official Unity bug tracker, which I did not know of when I posted that last comment. You should always use that! Menu: Help -> Report a bug

  10. Fb92c852295e493859447aa87b40062b?d=mm

    Braineeee

    Apr 09, 2015 19:55

    I don't understand how but this is still an issue... I have a picture I would like to post of the problem but that can't be done in the comments section here. I'm going to post it on the message board instead.

All about bugs

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