New UI Text Object Wont Let Me Change Its Value Via Script.

With the new GUI system, I have created a User Prompt for a UserName. And stored this variable in a game object Called ProfileManager. I am trying to access this variable from and outside script in the next scene, and show the players Username in a Text Object. but i cant seem to access the UI script to change its text values.

This is the code snip im having trouble with. in void Start, is not valid. I need to know what to call the UI ext script when calling from another object.

    public GameObject ProfileManager;
    public GameObject PlayerNameLBL;

    void awake(){
        if (ProfileManager == null){
            ProfileManager = GameObject.Find("ProfileManager");
        }
        if (PlayerNameLBL == null){
            PlayerNameLBL = GameObject.Find("PLayerNameTXT");
        }
    }

    void Start () {
        PlayerName = PlayerNameLBL.GetComponent<Text>().PlayerName;
    }

‘Using UnityEngine.UI’ at header

Thank you so much, were would i have found this on my own?

In the Scripting API section, then click UnityEngine, then UnityEngine.UI, then Classes, and finally Text. Alternatively, searching the Scripting API for “Text” and it’ll be the first entry that pops up. At the top of that page is a “namespace” reference, and that’s what you need to include at the top of your scripts when referencing that element in them.

Since Unity is really visual (the Editor), you’ll have to make the distinction in the documentation when you’re looking for a visual element or a scripting element. If you need help with a scripting element, be sure you’re checking the scripting API and not just the Manual (mostly visual).