#Array for loop

1 messages · Page 1 of 1 (latest)

strange prism
#

++ is shorthand notation for += 1.
What you want it just + 1 when accessing the array.

Also, to exclude the last item from the loop (so you won't run into issues with i + 1), simply subtract 1 from the total length of the array in the loop's exit condition:
for(int i = 0; i < path.corners.Length - 1; i++).

chrome pivot
#

Thanks alot, didn't think of that😂 👍