how do i make lights flicker

How can I make 5 point lights flicker on and off so only 1 is on at a time
I’m not very good at coding so the easier to understand the better but anything would help.

Thank you all :slight_smile:

// Make a list of all of your lights. You can add these in the designer.
public List lights = new List();

    void Update()
    {
        // Run this routine every 100 frames or so. Random.value gives a number between 0 and 1.
        if (UnityEngine.Random.value > .99f)
        {
            // Turn all of the lights off.
            foreach (Light light in lights)
                light.enabled = false;

            // Turn on one light at random. Random.Range returns a float greater than or equal to 0
            // and less than the count of lights.
            lights[UnityEngine.Random.Range(0, lights.Count)].enabled = true;
        }
    }

If you want to toggle the lights one after the other at a regular interval, you’ll need 1) a function to turn 1 light on and the other off. 2) A loop going through those light with a pause after each iteration. See coroutines.