- Home /
How can I make my NPC or character blink on being hit?
I am using Unity to make a 2d game. My NPC is modeled using Maya, and I am using a very simple shader Unlit/transparent on the materials. Now, I want to make my NPC brighten up with some red color but I am not quite sure how to do this, especially how to make the character brighten up.
Answer by Berenger · Feb 29, 2012 at 02:37 AM
You need an emissive color. Diffuse get multiplied by the light result, emissive is added.
A simple way to have it blink then, is to multiply the emissive color by a Mathf.PingPong( Time.time * speed, 1f) inside a coroutine.
Your answer
Follow this Question
Related Questions
Effects of Graphics.Blit to rendertexture are temporary 2 Answers
Always included shaders (Graphics settings) 1 Answer
Dymanic Mesh Hiding 2 Answers
Shader effect gone when I hit Play 0 Answers
Do TEXCOORDS need to be in sequence? 1 Answer