Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

(Case 763427) Multiline Text object cutting off last line of text

Discussion in 'UGUI & TextMesh Pro' started by MolluskJesse, Jan 20, 2016.

  1. MolluskJesse

    MolluskJesse

    Joined:
    Sep 12, 2014
    Posts:
    31
    Echoing a bug I filed with the Unity Bug Reporter here to see if anyone's experienced it and/or has workarounds or solutions.

    In Unity 5.3.1f1 & 5.3.1p3, there appears to be an issue with Text objects that have multiple lines and "Best Fit" enabled. The text object is failing to draw the last line of the entered text. So, for example, the Text object is only displaying 2 lines of an entered string with 3 lines. Here is a screenshot of an example in an entirely empty scene.

    Multiline_Bug_Screenshot.PNG
    For the values set into the "Best Fit" parameters of Min and Max size, there is no reason that both lines of text shouldn't be drawing.

    To recreate this for yourself, use the followings steps:
    a) In a blank project, create a Text object from the GameObject > UI > Text menu option
    b) In the created text object, turn on "Best Fit."
    c) Try typing in multiple lines of text and observe the behavior of the object in the scene.

    In Unity's FogBugz tracker system, this bug's case number is 763427.

    So, again, has anyone else experienced this and/or have you found any workarounds (besides adding a blank line to the end of the string of every affected Text object.
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    You could also ad a ContentSizeFitter to the Text object to make it expand it's width/height based on the text.
    However, I have noted this also works using CR's, so you need a blank line after your last line for it to size correctly.
     
  3. JesseLBusch

    JesseLBusch

    Joined:
    Aug 6, 2014
    Posts:
    4
    For anyone that comes across this thread. This is a known issue with the versions of Unity mentioned in the original post. It has been reported and fixed, but the fix will not be released until Unity 5.4 (as I was told via e-mail.)
     
    SimonDarksideJ likes this.
  4. MolluskJesse

    MolluskJesse

    Joined:
    Sep 12, 2014
    Posts:
    31
    I wanted to poke this chain to verify something. When I reported this bug back in 5.3, I was told it had been previously reported and would be fixed for 5.4. I downloaded and was testing out the 5.4 beta9, and I saw that this bug is not addressed. So please, can I get a verification that this will be fixed for the official release of Unity 5.4.
     
  5. MolluskJesse

    MolluskJesse

    Joined:
    Sep 12, 2014
    Posts:
    31
    Attached is a screenshot of the bug persisting in Unity 5.4.0b9. I have also file a new bug with the Unity tracking system: case 779069.
     

    Attached Files:

    Last edited: Mar 11, 2016
  6. sapsari

    sapsari

    Joined:
    May 30, 2013
    Posts:
    14
    Hit the same bug with version 5.3
     
  7. jhkimblue

    jhkimblue

    Joined:
    Mar 27, 2015
    Posts:
    14
    Please make a backport-fix for 5.3.6 users. ;(
    I found that it is working properly at 5.4... but we just updated unity from 5.1.3, we can't update it yet cause it has so much risk and work to do. ;( please fix it for older version users.
     
  8. MintPuma

    MintPuma

    Joined:
    Oct 30, 2014
    Posts:
    16
    I have a bug report submitted as well, but I've been noticing the problem when using an InputField. It still happens in 5.4.0f3 and 5.5.0b1.

    https://issuetracker.unity3d.com/is...t-display-whole-text-in-certain-circumstances

    I've been attempting to create a workaround by downloading the UI code (because it's open source), and not performing the SetDrawRangeToContainCaretPosition() function when best fit is enabled. So far it seems to be working, but you never know..