Hi,
I recently discovered shaders and it was a revelation to me.
I am currently working on a 2d pixel game and my character should blink after it was hit by an enemy.
Originally I wanted to realize this from an animation player. just alternate the opacity of the sprite but now I figured out that I can do the same by using shader code like
shader_type canvas_item;
void fragment(){
COLOR = texture(TEXTURE, UV);
if(COLOR.a > 0.0){
COLOR.a = abs(sin(TIME*10.0));
}
}
Now I wonder what the better solution could be.
Does the shader solution have any advantage over the animation player solution?
Thanks Bernd