I am trying to use an 'or' operator in an if statement, and Unity is telling me it's an unexpected token.
What does Unity recognize as an 'or' operator? Found little in the script ref.
Thank you for the help!
You use two vertical "pipes" for or.
It's nice, because it "short circuits". That is, if the first statement is true, it won't bother to evaluate any more statements. So if you have a statement that is likely to be true most of the time, more so than another statement, put that first for more efficient code.
answered Jun 16 '10 at 02:06 AM
What you currently have is:
Update: confirmed that, yet again, Eric5h5 is right - this code does work, I tested it:
The only question I would have, is if physical joysticks can generate spurious values, or whether Unity filters them out below a certain threshold.