Answer the question
In order to leave comments, you need to log in
How to change TextMeshPro text color?
Tried via GetComponent , but the error
"ArgumentException: GetComponent requires that the requested component 'Color' derives from MonoBehaviour or Component or is an interface.
UnityEngine.GameObject.GetComponent[T] () (at :0)"
public GameObject text;
Color colorText = text.GetComponent<Color>();</blockquote>
Answer the question
In order to leave comments, you need to log in
add library "using TMPro;" and instead of gameobject write TextMeshPro
and then write text.color = Color.and the desired color;
public TextMeshPro text;
text.color = Color.yellow;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question