Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity ui mask not working on google pixel device

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

like image 545
Vishal Avatar asked Jan 02 '17 11:01

Vishal


3 Answers

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

enter image description here

like image 154
Bahman_Aries Avatar answered Sep 27 '22 21:09

Bahman_Aries


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.

like image 38
Lotan Avatar answered Sep 27 '22 20:09

Lotan


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.

like image 25
Bizhan Avatar answered Sep 27 '22 20:09

Bizhan