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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Text stopped calculating its size in 5.2

Discussion in 'UGUI & TextMesh Pro' started by Devou66, Sep 9, 2015.

  1. Devou66

    Devou66

    Joined:
    Apr 6, 2014
    Posts:
    12
    So I have a little chat component and I use RectTransform with Text to show them in Scroll Rect.
    After updating to 5.2 all those objects are reporting width and height of 0.
    Because of this chat stopped working - all strings are 0 in size and are not visible.

    How do I make them calculate their sizes correctly?
     
  2. Devou66

    Devou66

    Joined:
    Apr 6, 2014
    Posts:
    12
    Still need help.
    Here are my settings:

    The overlord Chat object:
    Ig0fGl9.png

    The content object in that Chat:
    R7UWWdu.png

    The single line in chat:
    R7UWWdu.png

    The code that adds line to chat:
    q1I2kIZ.png

    What I want:
    A chat like window where lines appear on the bottom of the window. After a new line appears, the previous one is shifted up. This was working perfectly in 5.1


    Now in 5.2 this is broken. All lines are 0 width and height and are stuck on the bottom, invisible. If I change their size manually to something, I can see them and they behave normally. How do I make Texts calculate their sizes correctly?
     
  3. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,184
    Are you using nested canvas? We have fixed a bug for this for a patch release where elements were having their anchoring broken.
     
  4. Devou66

    Devou66

    Joined:
    Apr 6, 2014
    Posts:
    12
    No, I have one canvas. Someone help please
     
  5. Devou66

    Devou66

    Joined:
    Apr 6, 2014
    Posts:
    12
    I localized the error to the fact that I use Scroll Rect. Without it the lines format correctly, but do not scroll.