Ok, this may be simple but I can’t figure out how to do this… I want to call multiple gameobjects from an array with just a couple of lines.
As you can see, I want some of the gameobjects Active and some NonActive, but this isn’t working. Any help will be Greatly Appreciated!
public class Puzzle_Idol : MonoBehaviour
{
public GameObject IdolContainer;
public GameObject[] Idol;
public int IdolPosition = 1;
public AudioSource IdolSelectSound;
public GameObject Player;
[SerializeField] public int distanceFromPlayer = 5;
void Start()
{
for (int i = 0; i < Idol.Length; i++)
{
//This is where I'm lost. There must be a simple way of doing this. I've tried using commas.
Idol[5 & 6 & 7 & 8].SetActive(false);
Idol[0 & 1 & 2 & 3 & 4].SetActive(true);
}
}
}