UGUI Masks

What is the current status with the mask components (Mask & Rect Mask 2D)? I am getting inconsistent results, sometimes they work fine, other times they don’t, just showing a large white rect. They are consistant in whether they work or fail, but the same setup may work in one prefab, but not in another, or just in different locations. Is this a known issue? Are there known limitations?

1 Like

Additionally, UGUI masks don’t mask the rk hoverstate. Elements outside a scroll list for example, still show the hover states for those elements. (though the ui elements are masked, so it is just the faint glow.

Is this a known issue? Is it on the roadmap? Or is there workaround?

Hey Scott, would be super helpful if you could log this as a bug if you haven’t already so that we can investigate it further.

In general, we’re working on stabilization at large, so if you can isolate this issue and share a small sample reproduction that would help us a lot.

Much of it improved with the last release, but it seems that masks specifically require an ACTUAL IMAGE attached to function properly. and transparent ones don’t work. Normally in unity you can use the mask (or any image) without assigning a texture and will just render the quad with color. In PS you can’t. You have to create an image and add it. (for textures to not fail and masks to work)

Though the hover is easy to test, just create a scroll area with buttons (enough so some are hidden). On simulator and device, you can still see the PS hover states outside the mask.

I will try to log a bug for that, and slow performance and inconsistent pink boxes in pooled scroll areas. In general, is seems it unity/ps really struggles with dynamic ui content.

1 Like

Hi, the ui mask seems not working in visionos simulator, any work around for the mask feature?

This has improved with the recently release, but rotation in the sample project I provided still occurs. It is still being worked on?

1 Like

Sorry, I think this slipped through the cracks. Do you happen to know the incident number (IN-#####) for the sample project you provided?

We’re having a lot of issues with masks too. images flipped on an x or y axis won’t render inside a mask, even when I reverse the winding order of the image. Plus we’re seeing hover effects outside of masked scroll views, with those hover components being selectable

Hover outside of masked/visible locations is a known issue that we working with Apple to address.

I also don’t think we support Rect Mask 2D or Mask for UI. We do support sprite masking but not UI.

For us it is if the Cavas is rotated, elements spawned in a mask in a layout group, appear unrotated relative to the canvas. It is like the rotation isn’t getting applied in the PS clones, in editor the original looks fine.

It would be really helpful if we could disable the PS hover effect in UI. Round/non-square buttons, masked elements all look terrible on device.

It is partially fixed, the positioning works, but rotation is still not correct.

We were looking at this today and I believe we have a fix for the rotation issue that will go out in a subsequent release.

(Sorry if this was already covered elsewhere, but the issue with the toggles in that scene was a conflict with the background–for some reason, the background was blocking input for the toggles. Clearing the “Raycast Target” flag for the Image made the toggles start working.)

1 Like

This sounds a lot like an issue I’m experiencing in editor (editor only) where recast targets behind UGUI elements block input. Makes it really had to test in-editor. Is there a fix for that too?

For us it started working properly after we upgraded to 1.0.3. Though oddly I got a fix fail notice from the Unity Jira, then a resolved notice. Either way, it works as expected now. Thanks.

1 Like

is the rotation issue meant to be fixed in 1.0.3? We are on this package and are still getting incorrect masking issues:

This is a basic masking set up in a sample UI scene:

  • The white squares represent the masks

  • The coloured squares represent the image to be masked at 0,30,60 degrees

  • Expected result is as such:

  • Actual results:

  • With an embedded polyspatial package we can look at the alpha value of the mask in the MaskingShader:

the linked polyspatial objects appear to have the correct rotations

Is there a multiplication I could make to the UVtransform matrix or object position using the objects rotation in the MaskingShader to counter act or fix this?

We fixed one issue in 0.7.1 (which would have mainly affected rotations about the relative X or Y axis: that is, so that the mask wasn’t facing Z-), but there was another issue that will be fixed in the next release that mainly affects rotations about the Z axis (the rotated bounds weren’t being computed correctly). I don’t think there’s any good way to work around it at the moment other than avoiding those rotations.

It appears that issues in 1.1.4 are back from earlier version, or at least in part. RectMask2D is now experiencing the same issues that masks used to face. Magenta blocks out side the mask bounds that should be clipped, odd clipping when the parent is rotated.

Particularly frustrating as by switching from Masks to RectMask2D was the fix for some of those issues.


If you submit a bug report with a repro case and let us know the incident number (IN-#####), we can take a look.

I believe the issue is to do with nested masks. An inner RectMask2D is not clipped by the outer RectMask2D, if the inner mask lies outside the bounds of the parent mask. I’ve submitted a bug report with a simple reproducible project: IN-71067, and have created a gif to illustrate the issue. The grey area is a ScrollView, whose viewport is a RectMask2D. Each item is an image inside another RectMask2D.

1 Like

It is defiantly nested masks. And it definitely worked before. This one is critical and impacts shipping. IN-71085. (sample project added with all the variations). When can we expect this to be corrected?

Its really pain working around the many incomplete/unready elements to then have to deal with basically regression bugs for thing that was mostly working.