Okay, I must be going crazy... I can't find a single example of a for loop that doesn't increment by ones. I want one that increments on two's... I've googled it to death and keep finding this kind of example... Code (csharp): for (i = 0 ; i <=10 ; i=i+2) But unity gives me syntax errors if I use anything other than a simple i++ for the increment. Any ideas?
Can you use: Code (csharp): //for Javascript var i = 0; While (i<=10) { //do stuff i += 2; } would do the same thing. -Jeremy
Wha! I know you are trying to help, but that's simply not true in any language I know of. There is no semicolon after the third parameter. The first example is written correctly. It's already confirmed that it's a compiler error. Please don't post something unless you are 100%. If not, just look it up first. For instance, Google: for loop javascript example. Sorry for reacting strongly but I just don't like seeing false info posted in the thread.