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

    Jun 24, 2018 07:36

    Happens to me in 2018.1.5f.1

  2. 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. Ghosthowl

    May 16, 2017 06:15

    Still having this issue in 5.6.0f3

  4. Fritsl

    Feb 20, 2017 21:49

    Not fixed!!

  5. 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. Mr B

    May 16, 2015 00:13

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

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

    Apr 14, 2015 21:39

    Still an issue in 5.0.1f1 :(

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

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.