- Home /
Unity 2D sprite mask?
So I started using Unity a few weeks ago and I have this simple problem that I can't solve.
I wanted to create kind of a portal in my game and I expect the asset to dissapear when it enters it. I've developed a few games in HTML5 where I could easily create a mask that would hide everything in an area (in this case "behind" the portal). But I can't find a way to do it in Unity. Any help would be appreciated.
I'm trying to do something like this myself, did you ever figure it out? What was your solution?
Answer by phil_me_up · Dec 15, 2015 at 10:11 PM
You can add a mask component to do this ( https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-mask ) but I've had mixed results when dealing with curves, in which case creating a custom shader to handle the masking is your best bet.
Your answer
Follow this Question
Related Questions
Sprite.Create is not working 1 Answer
Cut out sprite alpha using other textures 1 Answer
Replace a sprite by another in every game object using it 1 Answer
Sprite Packer is always disabled [Problem] 1 Answer
Overlay texture on sprite 0 Answers