- Home /
scratcher with unity
How to make scratch effect (like in lottery tickets) with Unity3d? (Sample games: Scratch Kings, Scratchers)
You could create to planes layered over one another and use something like Vectrocity that draws lines and set the pixel arrangement to clear, kind of like your erasing it.
Answer by googler · Jun 14, 2012 at 06:45 AM
If anyone still interested, I advise to look http://www.arongranberg.com/unity/unitypaint/ , very useful
Answer by whydoidoit · Jun 08, 2012 at 10:19 AM
You could place an image to be scratched away on an object infront of the thing to be revealed, have a material with a special texture on it and the use SetPixel to set the alpha level to 0 on some pixels where you want the scratch to appear. You would need to do some maths to get the right position in the texture to update.
Yes, this works! But I need to draw continuous thick line after player's touch. How can I do it?
Well the best idea is to set a number of pixels around the one that you find, making sure not to move off the top/left/right/bottom sides by checking the coordinate.