Reputation:
I am having issues with Unity 5 / Android and masking. In version 4.6 the mask works as expected. However, I can not get it to work at all in Unity 5.
I have attached two images of what it should look like and what it does look like if anyone could shed any light onto the matter please; do I need specific settings for Android etc??? I am currently working on a blank project to try and get this sorted, so there is no code at present, just the scene.
Upvotes: 3
Views: 10648
Reputation: 4808
It's a late answer. However, To answer what OP asked, I would say using RectMask2D
instead of the regular Mask
could be a good workaround.
I've also provided another answer to a similar question with some images showing more details.
RectMask2D Control:
A common use of a RectMask2D
is to show small sections of a larger area and to somehow frame this area.
The limitations of RectMask2D
control are:
The advantages of RectMask2D
are:
Upvotes: 0
Reputation: 49
I searched a long time for the answer to this but I fixed this problem in Unity 5 by unchecking the "Disable Depth and Stencil*" Box.
Build Settings -> Player Settings -> Resolution and Presentation -> Disable Depth and Stencil
After that you need to re-launch unity (you will not see working mask if you dont)
Upvotes: 4
Reputation: 1825
Works Perfectly Fine for me.
Try to do this on a blank Scene.
Add UI Image. -> Will automatically make a Canvas.
On the Image-> Add Component. "Mask".
Now on the Image <- GameObject that you make, Add another Image. Name it Image2.
So you have something like.
Canvas->Image-> Image2.
Now go to Image with Mask component. And on the Mask Component TURN OFF "SHOW MASK GRAPHIC" <- Important.
Now for Image 2. Try to Change the BackGround them Move the Object around while looking in the GAME Window.
Upvotes: 0