Changing material color from code doesn't update the color of text

We are having problem with text color not updating when changing material color from code (changing “_FaceColor”). The material color changes but the text color stays the same.
Funny thing is that you have to only “touch” the material in editor for the text to update color.

Unity Version: 2020.2.x (last tested on version 7)
TextMeshPro version: 3.0.3 and 3.0.4

Since TMP is unaware that you have modified the material, it doesn’t know that it needs to update itself.

Assuming you are modifying the persistent material (ie. not an instance), the color changes should update automatically. However, if this happens to be the material used by a fallback font asset or an instance, then TMP would not be aware of this change.

After making the material change, see if calling SetMaterialDirty() does resolve the issue.

1 Like