Fading Alpha of GameObject from Left to Right

Hi,

How would you set about fading a GameObject progressively from left to right?

Any changes I make to the Alpha fades the game object evenly across the entire volume.

I’m really looking for some kind of dissolve effect that “eats away” the GameObject from a point of contact.

Any ideas of where to start please?

Thanks,
A

This is definitely going to require a custom shader; I suggest asking around in the shader forum for help.

1 Like

GameObject can not fade itself since have no graphics. You can create gradient fade texture and then apply it to mesh. This can be done either programmatically via Texture.SetPixel API, in fragment shader program, or you can just draw gradient in program like paint.net and import it in unity.
For example, if you create texture 2x1 pixels with firs pixel all white and second all black, it can be used as black-white gradient fade.