Hello! Sorry for bothering … I am having this error:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
this is the piece of code where I am getting error:
else
{
for (int i = 0; i < lunghezzaCompleta; i ++)
{
if (!Database.database.marca[i].Contains(marca1Selezionata)) { listaDatabaseDaFiltrare1.Remove(i); }
listaDatabaseFiltrato1 = listaDatabaseDaFiltrare1;
Debug.Log("Valore di I: " + i);
}
Debug.Log("LISTA FILTRATO 1; " + listaDatabaseFiltrato1.Count);
for (int x = 0; x < listaDatabaseFiltrato1.Count; x ++)
{
listaFiltrataModello1.Add(Database.database.modello[x]);
Debug.Log("Valore di X: " + x);
}
}
Now … while in the console I am having all values of int i … it’s not the same for int x
listaDatabaseFiltrato1.Count is giving positive results (int numbers) … so I can’t figure out why I am having this error!
If i get: i = 0, i = 1, i = 2 and so on … why can’t int x be 0,1,2,3 ?
Thanks for helping me understanding!