0 votes

var example = 10
var example_2 = 11

func ready():
if example == 10 and example
2 == 11:
print("hello World")

is this with the "and" right ?

Godot version 3.2.2
in Engine by (255 points)

1 Answer

+1 vote
Best answer

Yeah, that's correct. But, that's not really 2 if statements. That's a single if statement that's testing multiple expressions. And, yeah, you connect those with and or or. With and connections, all of the tested expressions must be true for the if code block to be executed. With or connections, at least one of the expressions must be true for the if code block to be executed.

by (12,282 points)
selected by

Thank you for answering.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.