Code (csharp): for (changingIndex = survivorIndex, looped = 0; closestSurvivor == null changingIndex < survivorTags.Length || looped < 4; changingIndex++, looped++) { closestSurvivor = GetNearestObject(survivorTags[changingIndex]); } It tells me an error of (,) . Please Help! Thanks in Advance.
I wouldn´t actually check the 'looped' variable in the head of the for-Statement. Actually I would advice you to store the looped in an int above the for-Statement and do the check for the loops inside of the for-Statement and count them up there. Here´s the Code: Code (csharp): int looped = 0; for (changingIndex = survivorIndex; closestSurvivor == null changingIndex < survivorTags.Length; changingIndex++) { if(looped < 4) { break; } else { closestSurvivor = GetNearestObject(survivorTags[changingIndex]); looped++; } }