Hi all, im trying to make a login system and so far from other question and answers on here ive got a working login, the issue im having is getting it to do something if the login details are wrong.
If its right it removes the login popup but if its wrong I cant seems to get it to do anything lol, any help with the would be greatly appreciated.
Thanks.
#pragma strict
var desiredUsername = "Iain";
var stringToEdit = "";
var desiredPassword = "admin";
var passwordToEdit = "";
public var wronglogin1 : AudioClip;
function Start () {
}
function Update () {
}
function OnGUI () {
// Make a multiline text area that modifies stringToEdit.
GUI.Label(Rect (10, 10, 60, 20), "Username: ");
GUI.Label(Rect (10, 35, 60, 20), "Password: ");
stringToEdit = GUI.TextField (Rect (75, 10, 200, 20), stringToEdit, 200);
passwordToEdit = GUI.PasswordField (Rect (75, 35, 200, 20), passwordToEdit, "*"[0], 25);
if(stringToEdit == desiredUsername){
if(passwordToEdit == desiredPassword){
gameObject.active = false;
}
}
}