I have a list of gameobjects and I want to cycle through the list and disable each object.
foreach (GameObject i in panel) { i.SetActive(false); }```
I am getting the error that I cannot convert char to gameobject. How do I refer to the gameobject?
thank you
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour
{
public List<GameObject> panel;
private void Start()
{
foreach(GameObject i in panel) { i.SetActive(false); }
}
}