Color changing animation

I have a 2D enemy sprite with two animations, EnemyIdle and EnemyWalk.

When he is hit, I want him to change his colour to red and back to white which can happen in any of the 2 animations.

Is there a way to achieve this with animations?

Hey,

You can do this trough scripting but i think the best way to do it is to use mecanim.
You can do this via mecanim and make a trigger. when your character is hit change the color. By switching the sprite to a red one in your case., or maybe you can make a animation where it changes the color of the material.

I usually experiment a bit to find a good way to it.

Zotey

You probably need to add a new layer to your animator state machine that way you can maintain the walk while changing the colour state on the second layer.