The text of a “Text Mesh Pro UGUI” is not displayed, until the Component gets disabled/enabled or any of its properties are changed. Please see the video below.
The problem for me is that all texts in all menus are gone. It seems I have to toggle each Text Component in every menu, which is near one gazillion. Is there a workaround for this issue?
The reason for the behavior is due to the fact the text “Input Source” is set to “Set Char Array” as seen in the image below when inspecting the text object with the Inspector in Debug mode.
Now the Input Source mode is set internally based on the source of the input. For instance, if the text is set via the Inspector or string, then the mode is Text or String. If the text is set via SetText() then it is set to SetText. Lastly if the text is set using the .SetCharArray mode then the input is set to that mode.
So to resolve the issue, simply change this value to Text via the Inspector in Debug Mode.
Now the more challenging / puzzling question is how did the Input Source mode get into that mode in the first place. Are / were you at some point setting the text via this SetCharArray() function?
P.S. Thank you for having taken the time to submit the bug report with project as it made it quick / easy to find the cause. Without the Repro project, I would have been guessing for a while.
Most likely all of those with SetCharArray will exhibit the same issue so I would switch all of them to Text.
The challenge here is figuring out how they ended up this way but most likely not worth investing time into it since manually changing them to Text will solve the issue. Now if the behavior returns then it would be worth trying to isolate what steps might actually lead to this.
Interestingly enough this is the first occurrence of this behavior and fortunately for other users, this thread will provide some insight as to how to resolve potential text not rendering in the editor.
Is there any case when it should not be set to “Text”?
I’m asking, because we have some automatic data validation tests and I could add a test that this “Input Source” setting must be “Text” always. This would allow us to automagically catch if it changes again in our project.
But the test would only work if TMP never assigns something else than Text on purpose.
Yes.
If the text is set via the .text property then it will reflect “String”.
If it is set via the Inspector then “Text”.
If via SetText() then “SetText”
lastly if set via SetCharArray() to “SetCharArray”.
I’m having the same issue but the set input source is grayed out and I can’t change it. Strangly enough the input source is getting set to char array only when i play the scene before that it is set to text. Even stranger this is the exact game object that works perfectly in another scene in the same project. any suggestions?