[SOLVED] Can't put int i in if statement in for loop- Help!

I get the error variable i doesn’t exist and I’m not sure why. Without the if statement I don’t get errors. I’m pretty sure I’ve also seen the use of if statements and whatever int was in the for loop used in the if so I’m really confused.

  int[] headx= new int[2500];
  int[] heady= new int[2500];
  int total= 2;
  
  void move()
  {
    for(int i=total; i>total; i--);
    {
      if(i!=1)
      {
        headx[i]=headx[i-1];
        heady[i]=heady[i-1];
      }
1 Like

That semicolon sneaked in, and so the IDE think’s it’s a body-less for-loop.

4 Likes

lol i’m blind thanks