I have an array list that cycle their enabled state using this code:
public GameObject[ ] gameObjectList;
private int index = 0;
public GameObject buttonGameOjectSwitch;
// Start is called before the first frame update
void Start()
{
foreach (GameObject go in gameObjectList)
{
for (int i = 0; i < gameObjectList.Length; i++)
{
gameObjectList*.SetActive(false);*
}
}
}
public void enableGameObject()
{
if (buttonGameOjectSwitch)
{
gameObjectList[index].SetActive(false);
index = (index + 1) % gameObjectList.Length;
gameObjectList[index].SetActive(true);
}
}
the list being UI button elements that are clickable. could someone help me with a script that would make the camera centre or lookat the active element so the camera always pans to the active element with it centred… Any help will highly appreciated still a serious newbie at coding so please bare with me…
