Time for action – create if statements with more than one condition to check
Modify
LearningScriptas shown in the next screenshot.Save the file.
In Unity, click on Play.

Note
Notice line 11 is using the AND operator, and line 16 is using the OR operator.
What just happened?
Here is the output you get in the Unity Console:

Code analysis:
The code on line 8 and its description:
bool theBearMadeBigPottyInTheWoods = true;
A
boolvariable is declared and assigned the value oftrue.The code on line 9 with its description:
int temperature = 40;
An
intvariable is declared and assigned the value40.The code on line 11 with its description:
if(temperature >= 35 && theBearMadeBigPottyInTheWoods)
An
ifstatement to test if both conditions aretrue.The first test is checking if the
temperatureis greater then, or equal to,35.The value stored in
temperatureis40, so this condition is true.The value stored in
theBearMadeBigPottyInTheWoodsis true. Therefore the first condition and the second condition...