c# System.IndexOutOfRangeException: 'Index was outside the bounds of the array.' code example
Example: IndexOutOfRangeException in c#
int[] test = new int[3];
void Start()
{
test[1] = 5;
test[2] = 12;
test[3] = 7;/*this wil cause an errror
becase it has an size of 3, but the
array index starts with [0], so you
have to write test[0],test[1] and
test[2]*/
}