Ok so I have this kill counter script it works fine and all but the fade part is not working. I got the fade code from the unity wiki site. It compiles and everything but when i test drive it like after I get 5 kills it wont show the warning message on the screen. If i get rid of the if statement if(kills==5) i see the message show up when i start up the game. But I want it to show up after the user kills 5 of the enemies. Again everything compiles with no bugs just that the message does not show up when i kill 5…
var guiSkin :
GUISkin = null;
var kills: int = 0;
var warning : AudioClip;
function OnGUI()
{
GUI.skin = guiSkin;
GUI.Label(new Rect(10, 60, 100, 30), "KILLS:");
GUI.Label(new Rect(110, 60, 150, 30), kills.ToString());
GUI.skin = null;
}
function Start () {
if(kills==5){
guiText.text = "Warning!";
audio.PlayOneShot(warning);
var colors = [Color.red, Color.yellow];
for (i = 0; i < 3; i++) {
yield Fade.use.Colors(guiText.material, colors, 1.5, false);
}
yield WaitForSeconds(2);
guiText.text=null;
}
}