|
what does the exclamation mark (!) does when placed before something (in a if, for example)? I can't find out...
(comments are locked)
|
|
It means "not". The 'exclamation mark' (!) is often referred to as the 'logical NOT operator' (Javascript reference page). Some examples... These two have the same outcome, but most people prefer to write it the second way:
It's also useful for 'flipping' bools - i.e. setting it to false if it's true, and setting it to true if it's false:
Hope this helps. Let me know if you need further explanation. i imagined this, but when i tested, it didn't worked. (i was using !Input.GetButtonDown("Fire3") as the condition)
Oct 07 '10 at 11:17 PM
kroltan bahuman
btw: thank you!
Oct 07 '10 at 11:17 PM
kroltan bahuman
No worries, if this answers your question please mark it as correct (click the tick). As for why your input check wasn't working, perhaps you could ask a new question with your whole script and I can take a look.
Oct 07 '10 at 11:33 PM
Marowi
(comments are locked)
|
