Array Issue

I am trying to make an array of lights and when a specific event happens it turns them all off. I have the array working and if I place a debug statement in the loop for it it will print off just fine.

I cant figure out how to make it turn off all my lights.

using UnityEngine;
using System.Collections;
 

public class DayNightController : MonoBehaviour
{

public GameObject[] lights;


void Update ()
{

for(int i = 0; i < lights.Length; i++)
				
	{
		lights.SetActive (false);
	}
}


}

I get this error : error CS1061: Type UnityEngine.GameObject[]' does not contain a definition for SetActive’ and no extension method SetActive' of type UnityEngine.GameObject’ could be found (are you missing a using directive or an assembly reference?)

Hey Davidflynn2

Please try the following:

lights*.SetActive(false);*

The solution here is that you need to access each item in the array individually.