Question by
dyhmichail · Mar 03, 2016 at 03:34 AM ·
textscript error
Text in UnityEngine.UI doesn't work
Hello everyone! I cannot understand why Text in UnityEngine.UI stopped to worked. In my previous project evetething was good, but in new project error NullReferenceException appears. I am using Unity.UI but it stay inactive (I mean grey color). The code is
private Text txtRef;
void Start ()
{
txtRef = GetComponent<Text>();
txtRef.text = "text";
}
I attached it to Text which atacched to canvas. What can be wrong?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612070400im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Dont destroy object when changing scene 1 Answer
How do You add a Scrollbar in a textbox C# code 0 Answers
Help with arrays of arrays please 2 Answers
Input Field Problem 0 Answers
uGUI Text draw calls 1 Answer