I am building a mobile game and also using TextMeshPro, but I’ve encountered a very strange issue that I currently cannot seem to fix no matter what I do, I’ve spent hours and hours trying to fix this and it is also frustrating having to make a build to mobile each time to check if it has been fixed.
The UI is fine in the Editor, but suddenly disappears when I build and test it on mobile (Android) - and it’s not just my Android device, I have tested it on multiple other Android, as well as iOS, devices and the issue remains the same.
I’ve attached two images to show the bug I am describing.
I remember reading up somewhere else about creating material presets to have separate materials for TextMeshProUGUI and TextMeshPro scripts, as the issue can be caused if both are being used in the same scene - but that hasn’t fixed it either.
One thing I should also mention is that this issue does not occur in all my scenes, only in specific scenes, though I am unsure of the reason why.
Does anyone have any idea on what the issue could be?
Are you using the same font assets in the scenes where this issue does not occur? If you are not see if using a different font asset in the problematic scenes changes the behavior.
In the scenes where everything works as expected, are you also using a combination of and or still both?
In your own code, and in the scene where the issue occurs, are you using anything like GUI.Enable = false;?
Yes, I am using the same font assets in the scenes where this issue does not occur so I have assumed that that might not be the issue (though I am still not 100% sure).
For some scenes where everything works as expected, I am also using a combination of and and there does not seem to be an issue - which I am finding very strange and have started to assume this might not be the issue too.
Nowhere in my code am I using anything like GUI.Enable = false;
Do let me know if there’s anything else you think could be the cause and if there’s anything you’d like me to test!
Really sorry if the information I provided is not useful in finding the issue so far!
Test #1: I tried using a different font asset on the objects that didn’t render correctly and it did render correctly!
Test #2: The other material presets still weren’t working, so I decided to create a completely new Material Preset from the Font Asset / Material that was having the issue and the texts now render correctly!
The issue is now solved, massive thanks again for all the help Stephan_B!
Oh, I had not tests on other Android versions, I have the only android-device: Samsung Galaxy A71, if it makes sense.
So I have about 10 canvases with screen space texts and the only world space text. So on some canvases texts are disappeared when I added this world space text.
I think I’ve had a similar issue to this, but I can’t quite tell. But thought I would explain what happened to see if it helps.
I’ve found a very specific situation, that is causing my text to blank out like others are explaining.
Linux (Ubuntu). Works fine on Windows.
A scene with both a Pro & a ProUGUI Gameobjects, using the same font/material.
Not sure if Unity version matters but currently on (2018.4.23f1)
The text goes blank when you change resolution from the default (mine is 1920x1080) to a new size with:
Screen.SetResolution(1280, 720, true);
Just that alone doesn’t cause a problem for me, what happens (and I think is the ‘problem’) is if you also have a camera in the same scene and it has the ‘Force Into RT’ flag set (This flag is hidden and you need to use Debug to set it). Then it causes the text to blank when res changes.
This flag is normally unset, but for some reason one of my cameras had this set. Apparently, there is/was a bug, when if you add post-processing to the camera, and then remove it… this flag gets left as ‘set’.
In 2018 someone else had this issue too and I am having today too. Why this is not fixed for 3 years. Why we have to separate materials. How can we know we should separate materials without looking forums.
EDIT: Also I am using same preset on both UGUI and normal TMPRO but some of UGUI ones renders correctly but some of not. Also I am using template project on my projects so one of the UGUI that not render correctly is from template and that one had no problem with my previous projects. Also I was using both TMPRO on that previous project. There is a huge inconsistency going on.
I have an issue where TextMeshProUGUI renders just fine in the editor and in some android phones, but there are some phones that has been reported that the text was missing.
Thank you for addressing the issue, I recently face with this issue (Unity 2022.3.5) when i have both TextMeshPro & TextMeshProUGUI in a scene, this scene render ok but then when my game load to another scene the TextMeshProUGUI doesn’t render (this issue only happen on the mobile device, not in the Editor). The solution is create new TextAsset for the object that doesn’t render correctly.
The problem I encountered is exactly the same as yours. Do you know the reason behind it? Why is this only happening on mobile phones? Why is it good before and not good after loading a new scene?