Hit flash!

This might be covered later in the course, but I figured out a (probably not best) way to make the enemies flash white when hit!
ezgif.com-video-to-gif

I basically used a coroutine that changes the material. I don’t know how to make it fade rather than be a binary flash.

Material baseMat;
Material hitMat;

IEnumerator FlashHit()
    {
        ChangeMat(hitMat);
        yield return new WaitForSeconds(0.05f);
        ChangeMat(baseMat);
    }

Good idea.

Also if you want smooth enemy move check out this post

This is how it looks

1 Like

Privacy & Terms