How to make part of sprite transparent at runtime

I want to allow the player to remove part of sprite at runtime thus creating effect like scratching off lottery ticket. How do I achieve such effect? Thanks in advance.

Use a material with an alpha mask shader. I don’t think Unity includes one, so you must find or write your own.

Taking you at your word, you want direct control over the alpha mask, as if your player is using the mouse or their finger to scratch the surface.

If not, all you need is the right shader and two or more alpha masks; one for opaque, the other for transparent.

If so, there’s plenty of info here and there about how to satisfy this request. You must translate your input into object, then texture space, then allow that input to manipulate the texture’s alpha channel.