Flash image while ammo is low - coroutines?

Basically what I want to do is have a “no ammo” image in the UI flashing (fading in and out repeatedly) whenever the player’s ammo is gone. I think I understand how to use Lerp but what I’m not sure about is how to make the process continue indefinitely until the player picks up more ammo. Would I constantly run a check in the Update() function, and if so, what would I do after that to make the flashing be continuous instead of constantly restarting the flashing every frame? I feel like this might involve coroutines, which I’m not particularly experienced with. Thanks for your help!

You could use coroutines, but I like to just use Update.

float counter;
float countdown;

void Start() {
countdown = counter;

void Update() {

    if(countdown <= 0) {
        //Do flashy stuff here
        countdown = counter;
    countdown -= Time.deltaTime;


There is easier solution. Add Image to Your UI, then on Image Component call (only once ie on event, when You want to show the image - NOT in Update):

Image Mysplashscreen;
float targetalpha = 0f;
float duration = 1.5f; //in seconds
Mysplashscreen.CrossFadeAlpha(targetalpha, duration, true);

Thanks for the help. About an hour after posting this question I realized I had completely forgotten about Unity’s built in animator. It ended up being super easy to do using that.