Hi everybody
Something’s wrong with my code. I’m trying to make some kind of sequence by pressing GUI button: First step, is the animation of falling bomb. Then, after 2 sec. from the beginning of those animation, the scene is changing to another (“ExplosionTest”). And that’s all. Two steps.
Console shows me: “WARNING: Boolean expression will always have the same value.” I’m trying to make this problem for two days but I can’t. Where is mistake? What I have to do to make it work? Any sugestions? Thanks a lot
var Bomb : GameObject;
var Anim : Animation;
var Expl : boolean;
function Start(){
Anim = Bomb.GetComponent(Animation);
}
function OnGUI(){
if(GUI.Button (Rect(1000, 570, 200, 100), "Fire")) {
Bomb.animation.Play("Fall", PlayMode.StopAll);
}
}
function CoUpdate(){
if(Bomb.animation.Play);
yield WaitForSeconds(2);
{
Application.LoadLevel("ExplosionTest");
}
}