Getting an out of bounds exception on an array with 3 indexes that’s not changed or referenced anywhere else in my project… Its not finding the third child of the object for some reason. Can someone point out whats wrong here I’m so confused
//Slots display
private GameObject[] slotsDisplay;
private GameObject slot0;
private GameObject slot1;
private GameObject slot2;
private void Start()
{
//slots init
slotsDisplay = new GameObject[2];
//Slot 0
slot0 = gameObject.transform.GetChild(0).gameObject;
slotsDisplay[0] = slot0;
//Slot 1
slot1 = gameObject.transform.GetChild(1).gameObject;
slotsDisplay[1] = slot1;
//Slot 2
slot2 = gameObject.transform.GetChild(2).gameObject;
slotsDisplay[2] = slot2;
}