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;
}