GUI password check question

what script should i use to check if a string has been typed?

would it look something like:

    var Text : String = "Level3";

    function OnGui()
    {

//code for identifying string here

     if(Text)
     {
      Application.LoadLevel("Level3");
     }
    }

thanks in advance!

I'm sorry young gentleman, it's very rude to ask from other programmers to write your code for you. In addition: "that's what i want, a full script on how to make a gui show up when you type the word" isn't a question but a request, you can pay someone and he/she will do it for you. Using google you can find plenty of tutorials for free, If you don't like it you can buy books on programming/Unity engine for relatively small price.

for anyone reading this for the first time, i changed the question to tell you what i really need help with.

2 Answers

2

Unity GUI Scripting Guide: http://unity3d.com/support/documentation/Components/GUI%20Scripting%20Guide.html

p.s.

I'm sorry young gentleman, it's very rude to ask from other programmers to write your code for you.

In addition: "that's what i want, a full script on how to make a gui show up when you type the word" isn't a question but a request, you can pay someone and he/she will do it for you.

Using google you can find plenty of tutorials for free, If you don't like it you can buy books on programming/Unity engine for relatively small price.

thanks for the link, that's all i wanted to know. just that little script in that reference link.

=) Ididn't want to be rude...

nah, you were right. i learned that i'm supposed to give you a script i made, and ask what i need to fix, or add. but i just needed ideas because i didnt know as much about scripting then as i do now.

My friend, each day you will realize how little you knew yesterday. I'm a programmer for ~8 years,and I'm using Unity for about a month now. ;)

Hello, put this script on a object with it's collider set to trigger. When you walk into the Object the text is shown.

var showtext : boolean = false;

function OnTriggerEnter(other:Collider) {
    showtext = true;
}

function OnGUI () {
    if(showtext == true){
        GUI.Box (Rect (Screen.width / 2 -100,Screen.height - 60,200,50), "Blah Blah Bla, Kryptic Message!");
    }
}

thanks, that was helpful. im working on modifying the GUI functions that you can find on the unity scripting reference. and im trying to figure out how to check if a person types a certain thing in the GUI password field. like if they type "next level please" they go to "Level2".

this is good for adventure games, so when you get near an object or an enemy, you could tell the player anything you want.