Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity 4.6b19 UI position reset after GameObject is disabled

Discussion in 'UGUI & TextMesh Pro' started by Subhajit-Nath, Sep 29, 2014.

  1. Subhajit-Nath

    Subhajit-Nath

    Joined:
    Dec 9, 2012
    Posts:
    31
    Don't know if I am doing something wrong here as it didn't happen till b18.

    MainCamera > Canvas (SS Overlay) > Image (window BG) > Button

    All with centered anchors.
    Set the position of the button as required (not in the center of the window).
    Made a prefab out of the Main Camera.

    Up until now everything is OK.

    Disabled the image (window BG).
    Applied the prefab again.

    When I re-enable the window bg, button position is reset to center of the window bg.

    The child elements' positions are reset to center whenever the parent gameobject is disabled.

    Am I doing something wrong or this is a bug in b19?
     
  2. hamstar

    hamstar

    Joined:
    Sep 25, 2013
    Posts:
    84
    I'm also getting this behaviour, but not sure of the cause. If you are able to recreate it please submit a bug report!

    Here's a screenshot to show what's happening. The top button shows how the objects were positioned before they got centered.

    buttons.png
     
  3. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,196
    Are you guys prefabing your canvas? I'm get this if I save my canvas as a prefab and when I apply changes to it... I sent a bug report.
     
  4. LuxUnity

    LuxUnity

    Joined:
    Sep 29, 2010
    Posts:
    716
    Same here.
     
  5. Subhajit-Nath

    Subhajit-Nath

    Joined:
    Dec 9, 2012
    Posts:
    31
    Sent a bug report yesterday, lets see what happens...
     
  6. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,181
    Thanks for the bug reports.
     
  7. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,196
    The issue persisted on b20.. :(
     
  8. Subhajit-Nath

    Subhajit-Nath

    Joined:
    Dec 9, 2012
    Posts:
    31
    Yes, just check on b20. The problem is still there.
     
  9. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    What's your bug# number? (for others to vote)
     
  10. Subhajit-Nath

    Subhajit-Nath

    Joined:
    Dec 9, 2012
    Posts:
    31
    They replied that it's a known bug and will be fixed shortly. My bug report was a duplicate one.

    I think the problem is elsewhere. The whole prefab system is broken. We are facing it big time.
    Chek out this thread. >>>
    http://forum.unity3d.com/threads/prefabs-broken-in-4-6b20.272216/
     
  11. Victor_Kallai

    Victor_Kallai

    Joined:
    Mar 5, 2014
    Posts:
    123
    Is anyone else still experiencing this problem? I'm running 4.6.1p2 and the positions of some rect transforms still sometimes reset (either to 0 or other values) after disabling/enabling those objects in the editor. It seems to happen in all sorts of layout situations, and not always, so unfortunately I have no precise repro steps.
     
  12. DiscoJustice

    DiscoJustice

    Joined:
    Aug 21, 2013
    Posts:
    15
    Yes, I'm seeing this happen as well on the same version as you, but haven't narrowed it down to a reproducable case yet. It might be related to layout groups or content size fitte
     
  13. DiscoJustice

    DiscoJustice

    Joined:
    Aug 21, 2013
    Posts:
    15
    Good news - I was able to reproduce at least one instance of this, and created a bug report out of it. It only seems to happen for me on objects nested 4 or 5 layers deep, but it is consistently reproducible in the example I gave.