I’m making a game in which when you touch the flag with your player, you win.
I want to create a gui when the player touches the flag.
This is my code:
static var Win : boolean = false;
function OnTriggerEnter (other : Collider)
{
if (other.tag == "PLAYER"){
Win = true;
}
}
function OnGUI(){
if ("Win" == true){
GUI.Box (Rect(0,0,100,100),"You Win!!!");
}
}
I attach this to the flag. But nothing happens…
What am i doing wrong?