- Home /
UI masking on nested canvas with overwrite sorting layer.
I have a very specific canvas which has a masking issue.
I have a UI completely on a UI sorting layer.
The panel is on layer 25, there is a mask on a scrollrect just a bit under it.
Within this scrollrect are 20ish items. they have a background, a particle system on layer 26.
Content on layer 27 (subcanvas with sorting override)
And then another particle system on layer 28.
The particle systems are using a sprite mask to mask them outside the scrollrect (configured to mask anything between layer 25 and 30)
Using this setup, the subcanvas on the items, layer 27 DOES NOT get masked out by the scrollrect mask. If i disable the sorting override on the content subcanvas, the masking works fine.
Is there any way i can make this mask also mask that subcanvas on it's overlay? What is Unity doing here on the background that makes this not work? Is there a workaround?
Did anyone find a solution for this? I also have a setup where a child inside a grid has it's own canvas which overrides sorting order and I need the scrollrect's viewport to mask them. Using unity 2018.4 btw.
Answer by noobs · Jun 28, 2019 at 06:54 AM
I need this too, and have similar setup, would you please share your fix?
Sadly we ended up making the UI more simple and later even dropped the project. It was attempted in 2017.1 or .3, so you could try a newer version or bothering unity. You can try that, but that is all i got.
Your answer
Follow this Question
Related Questions
Is there a way to adjust canvas z-ordering while using Alphabetical Sort in the Hierarchy? 2 Answers
Can I combine 2 or more UI masks? 0 Answers
Rect Mask 2D won't update if I move 0 Answers
Problem with Mask and Canvas (Sort Order) Unity 5 1 Answer
How would you mask a UI canvas like you would mask a sprite? 1 Answer