Search Unity

Resolved TextMesh Pro tags assigned by script not working

Discussion in 'UGUI & TextMesh Pro' started by TheBladeRPG, Nov 2, 2022.

  1. TheBladeRPG

    TheBladeRPG

    Joined:
    Aug 17, 2014
    Posts:
    25
    Hello,
    I do instanciate a TextMesh Pro and assign text to it with coloring tags but this is not working :

    TextPrefab => prefab of TextMesh Pro here with Ritch text activated

    Code (CSharp):
    1. private GameObject TextPrefab;
    2. GameObject addText = Instantiate(TextPrefab);
    3. addText.GetComponent<TextMeshProUGUI>().text = "<color=\"RED\">TEST";
    4.  
    this output literaly : <color="RED">TEST instead of outputing TEST (in red)

    what am i doing wrong ?
     
  2. TheBladeRPG

    TheBladeRPG

    Joined:
    Aug 17, 2014
    Posts:
    25
    resolved, some colors keywords are not recognized, example cyan, must put #00FFFF instead