- Home /
This question was
closed Oct 17, 2011 at 10:26 AM by
Graham-Dunnett for the following reason:
http://answers.unity3d.com/questions/177413/buttons-appear-and-disappear.html
Question by
richard.falcos · Oct 17, 2011 at 07:26 AM ·
buttonsdisappearappear
buttons appear and disappear
Hello everyone, I am using this code to open a door below by entering a code:
function Update () {
}var doorCode : String = "casa";
var stringToEdit : String;
var buttonMessage : String = "type Code";
function OnGUI(){
stringToEdit = GUI.TextField (Rect (20, 100, 70, 25), stringToEdit, 4);
if(stringToEdit == doorCode){
buttonMessage = "open door";
}else{
buttonMessage = "type code";
}
if(GUI.Button(Rect(95, 100, 120, 25), buttonMessage) && stringToEdit == doorCode){
transform.Rotate(-90,0,0);
}
}
I would add some element to the script to make the buttons appear when the player entering the site and go out the same Quendi. thank you
Comment
You can format your posted code by editing your post and selecting the code and hitting the 010/101 button
Follow this Question
Related Questions
Enemy appear / disappear 1 Answer
Guitexture appear/disappear 1 Answer
object dissappear and reappear 1 Answer
Distance activated GUI 1 Answer
Make GUI box appear and disappear 2 Answers