Search Unity

Scrolling interfering with selection in scrolling list

Discussion in 'UGUI & TextMesh Pro' started by JoeStrout, Oct 21, 2018.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I've got what I believe is a pretty standard setup for a scrollable list.

    upload_2018-10-20_16-30-16.png

    That is, the scroll view contains a content object (SongListPanel) which contains a Toggle Group, and then a bunch of toggles (just one — Song Button (0) — is shown here; it is cloned to create all the others at runtime).

    All works fine, except that this is on Oculus Go, and I'm selecting with a VR pointer, which is very hard to hold steady (compared to, say, a mouse). As a result, when I mean to click on a toggle to select it, very often it instead scrolls the scroll area (and utterly fails to select the item clicked).

    Is there any simple setting or tweak I can do to make it a little less likely to scroll rather than select? Honestly, most people are unlikely to scroll by dragging anyway; they're more likely to use the thumb pad (equivalent to a mouse wheel). So I would even consider disabling drag-scrolling if necessary.

    Any ideas?
     
  2. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    Yep, there is a quite easy fix for that: There is a threshold setting for when a movement is considered a drag (start scrolling). You can find it in the event system
    upload_2018-10-22_9-36-22.png

    If you set a higher value the drag won't happen as likely. If you're not only targeting Oculus Go, I would suggest setting a different value for oculus go, and for mobile or desktop change the value according to the dpi of the screen (here is a script for that: https://forum.unity.com/threads/but...icult-to-press-on-mobile.265682/#post-2583353
     
    JoeStrout likes this.
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Perfect! Exactly what I was looking for. Thank you!