how to convert a string to * but not change letters

hey guys, firstly soz for the confusing titles, basically im emulation a login screen because… well im bored and its good practise, so i was just wondering if its possible to make it so that what ever key i type in the password becomes an * to hide the pass, ill post what i got below… cheers

var login = "Enter Your Username";
var username = "matt";
var Entereduser = false;
var password = "admin";
var LogPass = "password";

function OnGUI () {

login = GUI.TextField (Rect (10, 10, 200, 20), login, 25);
LogPass = GUI.TextField (Rect (10,30,200,20), LogPass, 25);
}



function Update () {

	if(login == username  LogPass == password  Input.GetKeyDown("return")) {
	print ("you logged in");
		}
		
	if(Input.GetKeyDown("return")  login != username) {
		print ("you entered an invalid username or password");
		Entereduser = false;
		}
	if(Input.GetKeyDown("return")  LogPass != password) {
		print ("you entered an invalid username or password");
		}
}

you can’t and you don’t need to

PasswordField is there for a reason you know :wink:

haha thanks alot :stuck_out_tongue: i never came across that b4 :smile: but surly there must be a way to doit, just for practising putposes :smile:

for instance i could map a letter to a number for instance a could be 27 then * could also be a var for 27 :smile: so it can replace the a but still count as an a :smile:

practically there might be a way by checking the content every frame, storing the non * part in the real string and replacing them with * in the output.

the major problem though which I could forsee is that if they mess around within the *, especially deleting 1 or more, you don’t know what they deleted

haha ok man thanks alot for the reply :stuck_out_tongue: i appriciate it :smile: