Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

ScrollRect of buttons - issues clicking on button instead of dragging rect

Discussion in 'Android' started by Notter, Dec 28, 2015.

  1. Notter

    Notter

    Joined:
    Mar 8, 2015
    Posts:
    65
    Hello
    i have a scrollRect that's made out of buttons. where each button represents a level, and you can scroll left and right to see all the levels.

    the problem is that it's kinda finicky, and sometimes hard to actually press the button instead of dragging.
    And i was wondering if it's a common problem, and maybe there's something i need to do that I've missed?

    or maybe it's a design problem and buttons shouldn't be inside a scrollable area?
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    Are these actual buttons (e.g: a Button component?) or are you using some other mechanism like EventTrigger ?
     
  3. Dreams

    Dreams

    Joined:
    Sep 9, 2011
    Posts:
    22
    EventSystem has a Drag Threshold variable. Try increasing it, to see if button-presses becomes more reliable and less dragging happens.
     
  4. Notter

    Notter

    Joined:
    Mar 8, 2015
    Posts:
    65
    Lior - In some cases they are buttons, and in some cases toggles.
    but it's still apparent if it's just a buttons.
    No need to add event triggers. that being said, i did add an event to the buttons through code, but that shouldn't affect it.

    If you tap a button very lightly and fast, it will usually work alright.
    but if you move your finger a bit it will drag instead of click.

    Dreams - I wasn't aware of that, I'll give it a try, thanks!
    I wonder if it's something common to change for this though? cause it seems like it would be something that would work fine out of the box.