"for "Loop problem

I want this “for” loop to do the following:
a)Check between 1 and RelativePosition(aka, 4)
b)See if the current item is available
c)If it is, it should print Yeet
d)If it isn’t, the loop should skip this item and move on

But for some reason, it doesnt do that, and i dont understand why. Can anyone help?


 int RelativePosition = selected.currentSquare.idR;// aka, 4
 for (int i = 1; i < RelativePosition; i++)
    if (toBeFiltered*.available)*


  • else*

Using “break” exits the loop, you could use “continue”, but there’s no point, just take out the else statement