Hit flash effect
Simple hit flash / color changing shader
2 parameters;
Active – Sets the flash on/off
Tint – Set the color of the flash
Credits to; @triangledevv
With this one you can play around with the modulate even when the shader is inactive ( as I already almost went crazy looking for the issue)
Shader code
shader_type canvas_item;
uniform bool active = false;
uniform vec4 tint : source_color = vec4(1., 1., 0., 1);
void fragment() {
vec4 tint_copy = tint;
vec4 previous_color = texture(TEXTURE, UV);
if (active == true)
{
tint_copy.a = previous_color.a;
COLOR = tint_copy;
}
}