SpriteRenderer Alpha Not Changing, Help

Hi there,
I have a spriteRenderer whose alpha color I am altering, to gain a transparency in game. However, despite storing the spriteRenderer’s color and successfully altering the .a value, it is having no impact on the sprite itself. Any ideas?

IEnumerator runWhiteFlash(){

bool running = true;
whiteFlash.enabled = true;
Color clr = whiteFlash.color;
clr = new Color(255, 255, 255, 255);
whiteFlash.color =clr;

while(running){
clr.a = clr.a - 1;
print ("clr.a " + clr.a);
whiteFlash.color = clr;

if(clr.a <= 0){
running = false;
whiteFlash.enabled = false;
}

yield return null;
}
}

Color is from 0.0 to 1.0, not from 0 to 255.

have to make sure the shader being used supports transparency as well.

1 Like

Nice, thank you.
:slight_smile: