public Text not recognised
It worked previously, but when I updated another script in the game from using UnityEngine.UI to the newer using UnityEngine.SceneManagement the 'public Text' in this script turned red (is not recognised). Even now when I re-write the script from the beginning as soon as I type the word 'Text' it shows it's not recognised. I am very new to programming so any suggestions appreciated?
Answer by Dave-Carlile · Apr 11, 2016 at 01:30 PM
The Text component is part of the UnityEngine.UI namespace. This is called out in the documentation for Text.
So you need this at the top:
using UnityEngine.UI;
To include the namespace.
@Dave Carlile :
Thanks, I got rid of the UnityEngine.UI thinking it was completely replaced with the new UnityEngine.Scene$$anonymous$$anagement, but I realise now it has a different reason to exist. This scripting is tough, but thanks for your help, very much appreciated as my game is working exactly as I had hoped, even though only very basic!
Your answer

Follow this Question
Related Questions
Primary constructor body not allowed????? i don't see whats wrong? 1 Answer
Text is not visible when changing text color 0 Answers
Can't change to new string line inside my script 0 Answers
Removing an item from Inventory and updating item count on HUD 0 Answers
How to make Textmesh Pro effects on only one text object? 1 Answer