My main issue is that, I have a canvas, that contains an image which needs to be masked. This works fine by itself, but if this image is overlapping into a sprite mask, the sprite mask overrides the canvas mask, and makes parts visible that shouldn’t be visible.
First of all, how could a sprite mask interact with a canvas rendered image? I mean there is not even an option in a canvas rendered image called “Mask Interaction”.
Hi, this is not a solution, but as far as I know, both masking systems work with the stencil buffer to write their mask information. That’s probably why they can be overwritten. Maybe that’s a helpful starting point for some further investigation.
Heya I found that for a similar issue I was encountering the issue was not using a Sorting Group component when I should have been. Once the Sorting Group was applied to the correct game object, the issue was resolved.
Before:
After:
The hierarchy:
Added Sorting Group to component ‘rug_fences_treats’
Offending Sprite Mask was on component ‘mask’
The UI element in the screenshot was in a canvas in a separate part of the hierarchy, using a UnityEngine.UI.Mask component.