A common desired effect is to take a sprite and flash it white to show damage. I came across a few posts on how people are using the “GUI/Text Shader” material, and temporarily assigning that material to a sprite to make it completely white.
I gave this a shot and it works great… except if a sprite is behind a wall, you can still see it through the wall. The wall does not block it like it normally would.
Is there a way to prevent this from happening, and have the level block it out just like anything else?
Thanks and any help or advice is greatly appreciated!
you’re going to have to use a different shader, i tested a few and Legacy Shaders/Transparent/VertexLit has an emission property that you can set to white to make the sprite fully white. i use 3d however, so not sure how this would look for a 2d game, but any shader with an emission property should work.
Thanks for the suggestion. This didn’t quite work, but was close. I am using 3D as well.
I selected that shader, set all of the colors to white, alpha to 1 as well, and the sprite is mostly white, but around the edges its not all the way white. I played around with the “shininess” slider as well, but couldn’t get it to go all the way white.
It does work as far as it not showing through walls, it just doesn’t go all the way white.
any per pixel shader that has an emission property should work better for what you need. the standard shader supports emission, so if you’re using that you could just change the emission property.
if you’re not, you can also make a copy of whatever shader you are using, and put the color white instead of the final color return in the frag block(s).
make sure you rename it if you go down that path, as two shaders with the same name will create an error