Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

TextMesh Pro FaceColor not updating Submesh

Discussion in 'UGUI & TextMesh Pro' started by MrMatthias, Mar 6, 2018.

  1. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    i animate the faceColor of a text label programmatically, but the color of the submesh doesn't change. Doing this in the inspector works.

    I tried havePropertiesChanged and SetMaterialDirty with no success.
     
  2. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    Solved:
    Code (CSharp):
    1. text.color = value;
    2. text.havePropertiesChanged = true;
     
  3. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I will still look into this as changes the text color property should be reflected on the entire text object.
     
  4. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    setting the color property changes the submeshes correctly, setting faceColor didn't work.
     
  5. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The TMP_Text.color property affects the vertex color which is unique to each text object.

    The TMP_Text.faceColor alters the face color of the material and in this process creates an instance of the material.

    That makes sense given the sub text object is using a different material and likely an oversight on my part :)

    I'll try to fix that as soon as I have a chance.
     
    Last edited: Mar 7, 2018