Flickering effect?

Hello. Does anyone have any ideas on how I can make objects flicker for a second or two before they are instantiated? Thanks

You can use a co-routine that is launched on start, something like this:

void Start()
{
    StartCoroutine(Blink(5, 0.2f, 0.4f));
}

IEnumerator Blink(int nTimes, float timeOn, float timeOff)
{
    while (nTimes > 0)
    {
        renderer.enabled = true;
        yield return new WaitForSeconds(timeOn);
        renderer.enabled = false;
        yield return new WaitForSeconds(timeOff);
        nTimes--;
    }

    renderer.enabled = true;
}

You can enable and disable the renderer for a period of time. Ive attached a C# script as example:

using UnityEngine;
using System;
using System.Collections;

public class Test : MonoBehaviour
{
    float startingTime = 0;
    bool isStarted = false;
    bool hasBlinked = false;

    void Update()
    {
        if (!hasBlinked) //Check if the blinking occured already
        {
            if (!isStarted) //Check if the start time is set
            {
                //Set start time
                startingTime = Time.time;
                isStarted = true;
            }
            else
            {
                if ((Time.time - startingTime) >= 2) //Stop after 2 seconds
                {
                    this.hasBlinked = true;
                    this.renderer.enabled = true;
                }
                else //Blink
                {
                    this.renderer.enabled = false;
                    StartCoroutine(EnableRenderer());
                }
            }
        }
    }

    IEnumerator EnableRenderer() //Blink every time.
    {
        this.renderer.enabled = true;
        yield return new WaitForSeconds(0.2F); //Wait after each blink
    }
}