- Home /
WWW.text not display to UI Text.text
Hi , Why the download.text is displayed on Console but not in mytext.text UI ?
IEnumerator Start () { // Create a form object for sending high score data to the server WWWForm form = new WWWForm();
form.AddField( "id", id );
// Create a download object
WWW download = new WWW( url, form );
// Wait until the download is done
yield return download;
if(!string.IsNullOrEmpty(download.error)) {
print( "Error downloading: " + download.error );
} else {
result=download.text;
Text mytext = GetComponent<Text> ();
mytext.text = result;
Debug.Log(result);
}
}
}
Comment
Does your GameObject has Text component attached to it?