you can do something like that, such that it only go to the next row index when the object has reached the current location coordinates: