Switch vehicle

Can someone tell me where the problem with my code pls


using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.SceneManagement;
 public class SwitchVeh : MonoBehaviour
     private GameObject[] vehList;
     private int index;
     private void Start()
         index = PlayerPrefs.GetInt("VehSelected");
         vehList = new GameObject[transform.childCount];
         for(int i=0; i<transform.childCount; i++)
             vehList *= transform.GetChild(i).gameObject;*

foreach(GameObject go in vehList)

if (vehList[index])

public GameObject[] Tab;
public void SelectTab(int buttonIndex)
for (int i = 0; i < Tab.Length; ++i)
Tab*.SetActive(i == buttonIndex);*
public void ConfirmButton()
PlayerPrefs.SetInt(“VehSelected”, index);

It appear that

index = PlayerPrefs.GetInt("VehSelected");

give an index outside the array vehLists bounds.

Try this:

index = PlayerPrefs.GetInt("VehSelected");
Debug.Log("VehSelected: " + index + " of " + transform.childCount);

to check if your PlayerPrefs VehSelected is outside bounds of transforms child count.