- Home /
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!
dude no one will give a script that will do something like this!! thats advanced stuff ur asking for! maybe u should learn the basic GUI scripting. and i think that if u ask for Input.Get$$anonymous$$ey.Sting the engine will print everything that tip!!! because u cant make the script sensible to key words, that would kill the whole idea behind the game, right!!! so no one will help u! one game has done this before and they nailed it!!! so don't try it, u will always just be a rip off with such a game!
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 program$$anonymous$$g/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.
Answer by IJM · Oct 24, 2010 at 03:29 PM
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.
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.
$$anonymous$$y 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. ;)
Answer by Grune · Oct 24, 2010 at 06:23 PM
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.
Your answer
Follow this Question
Related Questions
Problem with accent characters in a GUIText 1 Answer
Filling GuiText with contents from a string array 2 Answers
Dialogue & GUI Text String 1 Answer
I can't print a int.ToString() variable in a guiText.text 1 Answer
why doesn't this script work 3 Answers