Search Unity

Scrolling on Unity UI doesn't work

Discussion in 'Daydream' started by fmielke, Feb 14, 2017.

  1. fmielke

    fmielke

    Joined:
    Oct 17, 2016
    Posts:
    35
    I read in the release notes from GVR SDK for Unity v1.2 (https://developers.google.com/vr/unity/release-notes) that scrolling should be supported for Unity UI. But it doesn't, at least for me.

    I used a common panel and scroll rect and cannot scroll there.

    Do you have any hints?
     
  2. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    Hello! I'm not sure exactly why it isn't working for you but hopefully the following questions will help us get at the issue:
    • Do you have a GvrPointerGraphicRaycaster on the parent Canvas of the ScrollRect?
    • Have you tried increasing the Scroll Sensitivity of the ScrollRect?
    • Are you able to Click and Drag to pan the scroll rect? Are you able to click on buttons?
    • Are you pointing at the ScrollRect while attempting to scroll with the touch pad?
    • If none of this helps, add some logging before line 393 of this file: https://github.com/googlevr/gvr-uni.../Scripts/EventSystem/GvrPointerInputModule.cs to make sure the scroll events are being executed.
    Thanks,

    Dan
     
  3. fmielke

    fmielke

    Joined:
    Oct 17, 2016
    Posts:
    35
    Thank you for the tips! with comparing the last one, I found out that my SDK update didn't work. Sorry for that. I updated the SDK and it works.
     
  4. fmielke

    fmielke

    Joined:
    Oct 17, 2016
    Posts:
    35
    Hi @dsternfeld ! Now there seems to be an issue. On the phone doesn't seem to accept the masked scrolling. In Unity Play Mode it is correct.

    The implementation is the common way: Panel-ScrollView(Image, Mask)-Text.

    Unity Play Mode:
    upload_2017-2-19_22-31-55.png

    Phone (Pixel):
    upload_2017-2-19_22-35-11.png
     
  5. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    Try using the script RectMask2D instead of Mask. https://docs.unity3d.com/Manual/script-RectMask2D.html

    If RectMask2D isn't flexible enough to serve your use case, then you should be able to still use the regular Mask if you have 24 bit depth buffer enabled. However, I wouldn't recommend this unless you really need it.

    If you go to File -> Build Settings -> Player Settings -> Settings For Android (Tab) -> Resolution and Presentation do you see a checkbox named "Disable Depth and Stencil" or "Use 24-bit Depth Buffer"? Which version of Unity are you using?

    Thanks,

    Dan