variable++ error...

int sayac = 0;

void Start () {

car = GameObject.FindGameObjectWithTag("car");
AIcar = GameObject.FindGameObjectWithTag("AI");
}
void Update () {


cardis= Vector3.Distance (car.transform.position, waypoints[sayac].transform.position);
aidis = Vector3.Distance (AIcar.transform.position, waypoints[sayac].transform.position);
if(aidis < 1)
sayac++;

Debug.Log(sayac);
}

return value sayac = 0, sayac = 1, sayac = 1, sayac = 1, sayac = 1,
first run working code but why does not continue ?

It’s because

if(aidis < 1)

The result is that sayac will only increment if it’s below 1.