Text colour changing with material
I am experiencing the issue with an imported font text colour not changing to what I set in the inspector resulting in always black text.
I have followed the advise to create a material and assign that to the font and this appears to work, but only on a static text field or button text.
I have a text field in a scrollview and after I apply the material the scrollview mask no longer hides the text outside of the scroll area?
If I set the material shader to GUI/TextShader I get the correct colour, but the srollview mask does not work, if I set it to no material the mask works but colour is black?
I have tried all manner of shader setting without any joy.....help anyone?
in fact this is happening on all fonts, including Unity standard fonts. I have even tried implementing the Rect $$anonymous$$ask 2D ins$$anonymous$$d of just $$anonymous$$ask with no luck.
So dont use a material on the font and text is always black but is masked correctly in scrollview, or use a material on the font to get the desired colour but mask does not work so text flows visible outside of scrollview????
Answer by piginhat · Jun 23, 2018 at 03:00 PM
SORTED!
I imported TextMesh Pro, used its Font Creation Tool and hey presto :-)
Not sure why the default Unity text component cant handle this?
Answer by Linaran · Apr 12, 2021 at 07:20 PM
There are two colors to manipulate in TextMeshPro. Material color and vertices color. These are multiplied to calculate the value of the final color. In my experience, the default material color is black for some reason. Black is (0, 0, 0) therefore multiplying it by anything is still black. Set the material color to white (1, 1, 1) and you'll be fine.
Late, but it's here for anyone googling the issue now.
Your answer
![](https://koobas.hobune.stream/wayback/20220612165307im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
TextBox.Color C# logic not working for two assets at once 0 Answers
Font Support 0 Answers
Custom fonts not working in build 0 Answers