if (two conditions)

my game is about to collect to 2 different object in certain time , for example apples and bananas, when I’m collect the score up to 40 for both of them, my scenes will load to win page if time=0 without those score i will load to lose page…but the problem is nothing happen when i collect those score until time =0 it’s will load to lose page not win page…
this is my code.

function Update(){

if(scoreApple>=40&scoreBanana>=40)
{
Application.LoadLevel(2);
}
if (Seconds<=0)
{
Application.LoadLevel(3);
}
}

please help me!!.thanks :face_with_spiral_eyes:

Try putting spaces in between the operators and variables

Edit: also make sure you actually attached the script to an object and if its enabled

Do you definatly have a level(2) and level(3)

Whitespace is irrelevant to the functionality of code, unless you use Boo.

The posted code is OK (please use code tags when posting code in the future though). Use Debug.Log to see what the variables actually are.

–Eric