Intro to 3D Game Development

0 of 193 lessons complete (0%)

Scripting Part 2: Making Code Respond to Players

Info: Logical Operators ‘And’, ‘Or’, and ‘Not’

You don’t have access to this lesson
Please register or sign in to access the course content.

You can make more complex conditions for your if statements using && (AND), || (OR), and ! (NOT). 

  • If you use &&, both the part on the left AND the part on the right need to be true for the code to execute. 
  • If you use ||, you only need one of the parts to be true. The other one could be false OR true. 
  • ! means the opposite of what something is, so if a variable that is set to true has a ! in front of it, the whole thing together will be false.