hello, i´m trying to display a win message when the player collides with a flag.
I get some errors, please help me to solve them!
Here’s the code:
#pragma strict
function Start () {
var Win : boolean = false;
}
function Update () {
if (CheckCollision.Win){
Win = true;
}
}
function OnGui(){
if (Win == true){
GUI.Box(Rect(Screen.width / 2 - Screen.width / 4 ,0,Screen.width / 4, Screen.height / 3), "YOU WON !!!");
}
}
Here are the errors:
-(7,20): BCE0020: An instance of type ‘CheckCollision’ is required to access non static member ‘Win’.
- (8,1): BCE0005: Unknown identifier: ‘Win’.
-(12,5): BCE0005: Unknown identifier: ‘Win’.
thanks!