Recently updated to 2017.2 and my ui masks stop working. In editor items are masked but after i press play -> items are not masked anymore and i can see them whole.. (i used mask and rectmask2d to check and none are working). Can anyone try if masking working in test project? In worst case i will reinstall older version. EDIT: Please ignore/remove -> after conversion to new version unity added strange materials to my Text elements and this was messing all up.
Still same error -> mask is not masking. I have to deactivate and activate canvas to make it works (in editor or in code on runtime). After i made build for android -> same mask not masking. On gameplay if canvas is deactivated and activated again -> mask is working great. I hard programmed setactive on canvas to reload it but it is not how it should be i think :] Also i start getting this error: Assertion failed: TLS allocator ALLOC_TEMP_THREAD... this is making me mad.
I'm experiencing Rect2DMasks breaking since moving to 2012.2.0f3. (2012.1.1p4 was fine). 2012.2.0p1 and 2012.2.0p2 are the same. My UI is broad and deep, with a lot of masked elements, which were all broken all the time. I've spent a lot of time trying to isolate and reproduce it, but it's pretty hard to nail down the problem. I'm using custom UI shaders and TextMeshPro, but neither of these should affect Rect2DMasking (I'm not using the Mask component as not all Android devices support stencil buffers - mind this isn't a problem for you on your Android builds). A hacky fix seems to be adding an empty panel with a Rect2DMask component (and no child to acutally mask) to the bottom of the Canvas heirarchy. This reduce the incidences but doesn't eliminate it completely for me; the Rect2DMasks will still break at times I popup panels or other elements, and restore when i hide them again. Perhaps it's related to canvas depth/sorting. I'm crazy backed up with work, otherwise I'd have bugged it a week ago already, but it's pretty annoying and it's not the only thing I've hit with 2012.2.0 (i have a prefab with a child object that insists on changing it's heirarchy order).
I disabled Depth and Stencil in Player settings on build -> and helped this time. Will see for how long. Can anyone explain why material on some TEXT component disabled masks in whole game? These were only on same canvas.
I use RectMask2D, However, works well only in first play!, But did some trick, by default I disabled RectMask2D, did custom script that enables RectMask2D in start. Now it works like a charm!
For anyone looking at this in 2022, you should double-check to make sure the height and width parameters of your object with the mask on it are non-negative. Having negative values will affect the masking system.
In Unity 2021.3.14f, if you have a Mask component and remove the image component and add a new image component, the Mask is no longer working. To fix this, remove the Mask and add it back. Imo this is an undesirable behaviour that should be fixed.