how to replicate this type of scratch card effect in Unity3D considering its for mobile.
Two cases 1. Clear part of screen where user touches. 2. How to trigger rewards after certain amount of image get reveal?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
Create a Texture2d and assign it to the Mask component then use SetPixel to set the alpha of pixels beneath the players finger to 0.
1) Use EventTrigger Component to track OnPointerDown and OnDrag on your scratch card.
2) Interpolate pixels at touch location based on touch position and screen size of Scratch Card.
3) Set pixels in Mask Texture to alpha = 0 where touched.
4) Apply changes to Texture2d.