Loading level/ scene in Unity

Hey there !

I face a wired problem in my project. I’m not able to load default level.

Following is my line to call level"1".

if(Result = true) Application.LoadLevel(1);

But, when I run the simulator, it always loads level 1. It does not check “Result” condition.
Also, in the console, Debug log says ‘Result’ is true when I checked. :frowning:

Can somebody please help me ?

Use == for comparing 2 variables

The code you have there will set result to true and load level 1.

Works like WOW ! like a legend :slight_smile:

thats why you should write constants first in comparisons: if(true = Result) and the compiler complains and you would have saved some time for debugging. the compiler is the best debugging tool you have at hand. use it to your advantage.

Noooo - not the Yoda conditional :slight_smile:

1425161--75234--$yoda_stfu.jpg
not intended as insult. it just fits here ;).