Loop stopped unexpectedly.

Good morning.
I made a script with a short loop:

for(int i = 1; i <= multiple.Length; i++)
		{
			Debug.Log(i);
			lastSide = sideStarted = (int)features.multipleSide*;*

_ lastPosition = features.Position*.position;*_

* for(int y = 0; y <= randSize; y++)*
* {*
* if(y%2==0)*
* {*
* Random(bla);*
* }*
* else*
* {*
* if(y == randSize)*
* {*
* Random(blabla);*
* }*
* else*
* Random(blablabla);*
* }*
* }*
* Debug.Log(i);*
* }*
When the multiple.Length equals 3 the loop does not continue and does not make the second loop and I do not know why. What I’m doing wrong? I tried using “continue;” after the second “debug.log (i);” but without success.
Any help will be very helpfull.

The most likely mistake is that there is an IndexOutOfRangeException. C# uses zero based so structures such as arrays start with the 0th element and stop at Count-1 rather than start with the 0th and stop at Count. That is why you don’t see

for(int i = 1; i <= multiple.Length; i++)

since the correct way to go through an array is

for(int i = 0; i < multiple.Length; i++)

Second, make sure you are not changing the value of multiple.Length. Instead of

Debug.Log(i);

use

Debug.Log(i+" "+multiple.Length);