I wanted to do something different and try out for loops but for some reason, my for loop is not stopping when both “i” and my list count equal to one. Is there something I’m missing?
// Should stop when i is not less than list count
for(int i = 0; i < truck.GetComponent<T_Info>().deliveryList.Count; i++) // Comparing "i" with list count
{
// Goes through each item in list and determines income amount via loop
currentIncome += truck.GetComponent<T_Info>().deliveryList<em>.transform.GetComponent<I_Packed>().packedValue * 10;</em>
i++;
Debug.Log(i);
}
----------
P.S: Sorry for the messy formating! Also all you need to know there is a list of game objects that I am comparing to “i” value.