Input Field Problem when set to Password

I’m probably missing something really simple but I am unable to collect the text that is entered into a password field, I only get the *'s.

My code looks like this:

Text txtPass
txtPass = rtPass.GetComponent<Text>();
string strPass = txtPass.text;

And when I enter the word password into the input field strPass contains “********” so how do I get out “password”?

Thanks.

Use InputField.value instead of .text…

Text txtPass
txtPass = rtPass.GetComponent<Text>();
string strPass = txtPass.value;

As a FYI this is changing for the next release as everyone seems to confuse text for what they need to use. The new names are .text (replaces .value) and .textComponent (replaces .text). This also make it more uniform to Text.text

I got mixed up because I was using the Text item that was a child of the InputField instead of the InputField itself.

This works:

    InputField ifPass
    ifPass = rtPass.GetComponent<InputField>();
    string strPass = ifPass.value;

i have created inputField and script attached to this .i am getting the error “rtPass” doesn’t exist in the current context