Hey guys,
I’m working on a 2D game for phones and tablets and i am trying to figure out how to allow the player to “wipe” something like (lets say) oil off of the screen after it hits a collider. so basically what would happen is a sprite that looks like oil appears and if the player fails to dodge it, it “splatters” all over their screen and they have to wipe it off to clear the screen. how would this be scripted in c#?
I think he needs to remove(hide) part of a texture at run time(like on Mario 3D Land when the Squid squirts the screen which you wipe off via touch), somewhat more difficult to achieve. I can only think of using some sort of Depth Mask type shader with an overlay, but I think that would be the wrong solution to this as well...
– MrSoadMrSoad, that's exactly what I'm trying to do :)
– PandanzyThought so, thought I should say something as that did not seem like a very helpful answer at all. The first time I've ever tried to vote someone down, but I found out I don't have permission to do so until I get 100 karma... Soon! I will do a Google search and see if I can find any links for you.
– MrSoadI found this, not tested but it could be help : http://stackoverflow.com/questions/12723038/erase-texture-off-of-plane Also there is this : http://wiki.unity3d.com/index.php/Dissolve_With_Texture And this : http://www.clover-studio.com/blog/custom-mask-shader-for-unity-3d-weve-developed-for-a-childrenss-game/ Good luck, I hope one of these holds the key for your solution.
– MrSoad@MrSoad: I agree that the answer is a bit lacking of details, but it suggests the right thing. Downvotes are for misleading or wrong answers. All he needs is a shader like the <a href="http://wiki.unity3d.com/index.php/Dissolve_With_Texture">Dissolve_With_Texture</a> shader you suggested and then he needs to "paint" into the mask / guide texture. However that is only visual. If it should have any effect on gameplay you have to do some hit testing against the mask texture itself, or create an approximate mesh out of the texture to act as collider.
– Bunny83