Nicat Nicat - 10 months ago 29
C# Question

If all 3 conditions are true

l have an if statement with 3 conditions:

if (firstbool == false & Input.GetKeyDown ("space") & secondbool == false) {
doSomething();
}


l want this program to do something only when all 3 conditions are true. But l don't know which operator l should use.

Answer Source

You mean to do something like this:

if (firstbool == false && Input.GetKeyDown ("space") && secondbool == false)

Use the && operator.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download