Double If condition syntax ?

Can anyone tell me if this is the correct syntax for checking two conditions exist ,I want to load the next level if the Lap is more than 5 AND the besttime is less then 90 seconds. It doesnt seem to doe anything ,yet throws up no compiler errors ?

This works

if (lap==5) Application.LoadLevel (1);

but this does not ?

if (lap==5 && Bestime < 90) Application.LoadLevel (1);

Im guessing im not getting this right ^^ can anyone point me in the correct direction please :slight_smile:

Personally I hate 1 liners. Anything that does more than 1 specific thing, should be in more than 1 line! It also makes code much easier to read.

If you want to split your code into multiple lines, you have to wrap it in {}

//So this:
if (myCondition) myFunction();

if (myCondition) {

//Same with multiple conditions
if (myCondition && myCondition2) {

Hope you write better code tomorrow than you do today :slight_smile:


PS: I don’t understand why your code doesn’t work though??? It works for me!