function Start () {
if ((whichTeam != 1) || (whichTeam != 2)) {
Debug.Log ("Invalid team value");
}
}
It doesn't work, just writes Invalid team value to the log every time I hit play, no matter what the value of whichTeam is. I am confused. Seems to work if I change the `!=`'s to `==`'s, and also works if I just put `(whichTeam != 1)`
Easy to work around, but I just want to know, what's wrong with this? Or is Unity incapable of handling that?
What are the possible values which team can be? If it's 1 or 2 then it will always go into there because the OR operator. If which team is equal to 1 the second condition will let it pass as true and vice versa.