Answer the question
In order to leave comments, you need to log in
How to change text in text mesh?
Looked at the examples and made by analogy
public GameObject CountText;
void Start(){
CountText = transform.Find("CountText").gameObject;
TextMesh text;
text = CountText.GetComponent<TextMesh>();
text.text = "99";
}
MissingComponentException: There is no 'TextMesh' attached to the "CountText" game object, but a script is trying to access it.
You probably need to add a TextMesh to the game object "CountText". Or your script needs to check if the component is attached before using it.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question