Unity ui mask not working on google pixel device
Asked Answered
S

3

5

I am making a scrolling ui panel and apply mask to ScrollRect component, which should hides parts outside panel area. I am using unity version 5.4.2f2-GVR. Mask work correctly on pc when i deploy it on google pixel device its not working. Is this bug of unity version or something else....

enter image description here

Sellers answered 2/1, 2017 at 11:54 Comment(4)
Do you have another child mask that disabled?Feller
No. I add mask only on parent that has ScrollRect component attached.Sellers
Try Bijan's solution. If that does not work, got to Help->Report a Bug... then file a bug report. This question has been asked more than 2x within the last 2 weeks so I believe this is a bug.Feller
Thanks for your suggestion.Sellers
T
8

I got around this issue by using RectMask2D Component instead of the regular Mask.

enter image description here

Taddeo answered 3/1, 2017 at 11:41 Comment(0)
B
3

If somebody else got this problem and Bahman_Aries solution is not enough, try this:

File > Build Settings > Player Settings>XR Settings (or Other settings if you are working in older versions of unity) > Daydream (click on the small arrow) > Depth Format.

And set that to 24-bit depth | 8-bit stencil.

This is cause you need a stencil buffer.

Blackguardly answered 12/3, 2018 at 12:6 Comment(0)
S
2

ScrollRect component has this weird behaviour when an image in its content has its material set to something other than none.

Unset the material to None and it should work.

enter image description here


If every child of content already has no material, then it could be a bug.

Selfrestraint answered 2/1, 2017 at 13:11 Comment(4)
There is no material attched to its image content.Sellers
@vishal you mean those white rectangles has no material?Selfrestraint
No. I make image content source to None and fill with white color.Sellers
@vishal no? I added a photo, this is what I mean.Selfrestraint

© 2022 - 2024 — McMap. All rights reserved.