Input Feild

Having troubles with Input Fields
CODE:

#pragma strict

var username : String;
var inputField : UnityEngine.UI.InputField;
var nameDisplay : UnityEngine.UI.Text;

function Update () {
username = inputField.text;
}

Can anyone tellme whats wrong?!?

Can you tell us what the error is so we can help?

I believe that should be in OnGUI(), not update. But I may be wrong =)