UnityEngine.UI is not working.
I am trying the following script :
using UnityEngine; using System.Collections; using UnityEngine.UI;
public class TextController : MonoBehaviour {
public Text text;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
While typing the 3rd line, using UnityEngine.UI; , I was supposed to get suggestions. But didn't.
And after writing it, the Text in line 8, public Text text; , is supposed to change color.
But it is not working.
I am new here. How can I fix it?
Answer by vittu1994 · May 17, 2016 at 03:17 PM
Have you tried saving the script? And is it located in your Unity project folder? Your code looks valid to access the Text class but if you cant inheret from MonoBehaviour u cant access its UI
Answer by allelof · Sep 12, 2019 at 12:53 PM
Have the same problem,Have the same problem. When adding "using UnityEngine.UI;" it does not give me any suggestions nor working to add "publix Text".
Your answer
Follow this Question
Related Questions
UI Text: Words at end of line jumping to next line 0 Answers
ui Text not responding to collider 1 Answer
Scripting Errors 1 Answer
Deleting random objects in started project 0 Answers
How do i change a color of an individual alphabet of a UI.Text 2 Answers