Does **!=** mean isnt equal to, the oposite of **=** ?

Does mean and in general? Im getting mixed up between , and **+**

Cheers!

Does **!=** mean isnt equal to, the oposite of **=** ?

Does mean and in general? Im getting mixed up between , and **+**

Cheers!

1 Like

!= means “not equal to”

is the logical AND operator, which can be used to check for 2 conditions in the same if-statement, e.g.

```
if( x == 1 y != 1 )
{
dostuff
}
```

Additionally, there is also an OR operator, which is ||, and can be used in this way:

```
if( x == 0 || x == 1)
{
dostuff
}
```

to check the value of x. stuff will be done if x is equal to 0, or x is equal to 1.

Exactly what ande said above. You can even mix them together, such as

```
if( x != 0 (y>0 || abool))
{
some stuff
}
```

The bool is basically a pre-defined boolean, and if you didn’t know, booleans are really easy to use with if statements (basically you just use the boolean name to check if it’s true, or !booleanname to check if it’s false)

So with AND () they BOTH need to be true for the script to continue?

and with OR (||) only ONE needs to be true for the script to continue?

Cheers!

Yes, that is correct.

Yay! Cheers all!

If you want more stuff to solve (If you have the time…) Check out my other questions. Thanks all!

http://forum.unity3d.com/threads/226021-Help-with-List-function

http://forum.unity3d.com/threads/226024-Get-function-error-Not-working