[SOLVED] Unity.UI.Text can't be found

So my Unity.UI.Text can’t be found.

It says I may be missing an assembly reference, but I checked the references in MonoDevelop and it says it’s using UnityEngine.UI as a reference. As well as that, it’s using Text too. The Text in the class will not change to blue so can’t be found.

I tried restarting Unity and as well as that I’ve reimported all my assets.

Version: 5.4.2f2 (I understand we’re using 4.6 in this section at the moment, but I can’t see any issue as to why that wouldn’t be in there anymore).

Thanks!

EDIT:
I’m a dummy. If I read the error properly I wouldn’t have made the mistake. I was referencing text.Text (As I thought it was referencing my text asset rather than the actual library, obviously the reason for drag and dropping the asset in makes sense now!) instead of text.text. I’m tired, forgive me! :blush:

2 Likes

Hey @Tom_McCloud,

Quite a few people have a blip on this one, I think partially to do with the naming of the variable. You could for example name you local variable story instead of text, then the code would read story.text and in the Inspector you would have the publicly exposed variable displayed as Story for dragging the text.ui item into. It reduces the amount of times the word text appears in a sentence :slight_smile:

Hope this is of help.

Privacy & Terms