Search Unity

UI Objects moving and resizing glitch

Discussion in 'UGUI & TextMesh Pro' started by rroyermoraes, Oct 1, 2019.

  1. rroyermoraes

    rroyermoraes

    Joined:
    Oct 25, 2015
    Posts:
    5
    I'm having some problems with some UI objects in Unity 2019.3b4. Some elements just start moving a resizing themselves, making it impossible to work on the UI of the game. I'm attaching a video showing the problem. Does anyone have any idea of what is going on, or if its some sort of bug.
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    This auto resizing and scaling is a feature of RectTransforms to that UI can be designed to fit nicely on a wide variety of screen shapes and sizes. In the upper-left of your RectTransform, there is a picture of a couple boxes with some red and blue lines and arrows. Those "anchor presets" control how that object moves and resizes when it's parent moves and resizes. The blue arrows represent how the object should automatically resize, and the red lines represent which part of the parent should the object's position stick to.

    First thing in your video, you are resizing a vertical layout group, and it's children all have anchor presents that cause them to scale based on the height of their parent.

    Second thing you select in your video is the text. Your text anchors have a horizontal blue arrow, which means it will automatically stretch horizontally as it's parent does. Your text anchors do not have a red line, which means they will not re-position based on the size of your parent.
     
  3. rroyermoraes

    rroyermoraes

    Joined:
    Oct 25, 2015
    Posts:
    5
    I know about all those behaviors, the thing is that the elements are getting resized by themselves, even if im not interacting with then in any way, this project was created in unity 2018.3, and I had no problem. And its not only on this canvas. I'm having similar problems in different scenes and canvas.