Search Unity

UI Elements keep resetting position to 0, randomly

Discussion in 'UGUI & TextMesh Pro' started by ayrton2389, Oct 19, 2014.

  1. ayrton2389

    ayrton2389

    Joined:
    Oct 25, 2013
    Posts:
    26
    Got a pretty nasty problem.

    Since i installed 4.6 beta 20 about 2 days ago, some of the UI elements keep resetting their local position to 0. It seems to happen at random. Random elements, from random panels, at random times.

    Has this happened to anyone else? is there a fix or workaround?
    Any help would be greatly appreciated.
     
  2. Titirez5

    Titirez5

    Joined:
    Oct 19, 2014
    Posts:
    17
    Hello,

    I had a prefab made from a canvas. Inside the canvas there were some panels and each panel contained some buttons. Only one of the panels was by default visible, the others were hidden (inactive) and shown only when the user did some action (ex: hit pause button -> show pause panel). The buttons inside the panels that were hidden always reseted to 0 every time I applied the changes to the prefab (save prefab changes).

    The workaround I did was that I no longer hide any panel by default (from object inspector), they are all visible and I hide the ones that need to be hidden at runtime, on the "Start()" function.

    And yes, the first time a noticed this was in build 20. I had the same UI setup in build 17 but I didn't see this issue there.

    Hope this helps.
     
    Last edited: Oct 19, 2014
    OnyxFlame and ayrton2389 like this.
  3. ayrton2389

    ayrton2389

    Joined:
    Oct 25, 2013
    Posts:
    26
    Thank you!
    That`s exactly what i was doing, too. Hiding / showing different panels. I`m gonna try your workaround tomorrow.
    Hopefully, it`s gonna get fixed in the next build. It is pretty frustrating.

    Again, thank you very much. You just saved me A LOT of headaches.
     
  4. OnyxFlame

    OnyxFlame

    Joined:
    Apr 24, 2014
    Posts:
    3
    I noticed the same problem in build 20, the issue was not there in the build 17.
    Thank you Titirez5 for the workaround.