Search Unity

Input-Blocking Objects on a Scroll Rect

Discussion in 'UGUI & TextMesh Pro' started by mittense, Oct 4, 2014.

  1. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    So, I have a bar of items within a Horizontal Layout Group in a Scroll Rect. These items have an object derived from the following interfaces:

    IPointerDownHandler, IPointerClickHandler, IDragHandler, IEndDragHandler

    Since this object is intended to allow the user to drag the contents from the object to another part of the screen, but I really only want that functionality if the user drags the object *up*. If the user drags horizontally, I'd like the normal ScrollRect scrolling functionality to function as-normal. Is there any way to accomplish that?
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    On your dragging script you could have a reference to the scroll rect and pass the movement to it if it meets your criteria.