Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

TextMesh Pro [Bug] Text can't be changed with the text property after using SetText()

Discussion in 'UGUI & TextMesh Pro' started by MartinIsla, Apr 3, 2020.

  1. MartinIsla

    MartinIsla

    Joined:
    Sep 18, 2013
    Posts:
    72
    Hello!

    Two days ago I spent my entirely workday (and a little more) debugging a weird bug.

    After clearing a text, I didn't seem to be able to show it again. Worst thing was it only happened in the build, not in Unity, so debugging was way more painful.

    I wasn't disabling the text component, just doing
    text.SetText("");
    , so I assumed it was maybe problems with Layout Groups or logic issues in my code (I did have problems with that before, but fixed them).

    Turns out I cleared the text using SetText() but when I set the new text I used the text property.
    It's not right to be inconsistent with these things, I totally missed it, don't be like me.

    I think this is a bug because it only happens in the build and because the docs say there should be no difference. If it was my bad, it would be nice if it also failed in Unity. I was able to replicate it in a new project and reported it, Case #1233179
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,680
    Thank you for submitting a bug report. I will take a look as soon as possible.

    P.S. I ran into another report previously which I resolved. It is likely whatever that fix was should resolve your issue. I will know more when I take a look at your case.
     
  3. MartinIsla

    MartinIsla

    Joined:
    Sep 18, 2013
    Posts:
    72
    Let me know what you find! Sounds like a fun one.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,680
    Had a chance to take a closer look and this issue should have been resolved in one of the preview release of version 2.1.0. The latest is 2.1.0-preview.8.

    Please test in that version and let me know if everything works as expected?
     
unityunity