Search Unity

Scroll Rect interactable

Discussion in 'UGUI & TextMesh Pro' started by dakka, Oct 5, 2014.

  1. dakka

    dakka

    Joined:
    Jun 25, 2010
    Posts:
    113
    I have a canvas group parent with a scroll rect as one of the children.

    Setting the canvas group interactable true/false does not alter the scroll rect only the scroll bar. Leaving pointer clicks able to drag the scroll rect.

    It would seem scroll rect needs an interactable setting ?
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Yes, please log a bug.
     
    dakka likes this.
  3. dakka

    dakka

    Joined:
    Jun 25, 2010
    Posts:
    113
    For completeness here is the outcome from QA team:

     
  4. Geriko

    Geriko

    Joined:
    Feb 17, 2017
    Posts:
    9
    I had to solve something similar. The way what I found is to set false the scrollrect's horizontal/vertical property when you want to Turn it Off, and set to true when you want to Turn it On.

    It's not mean that its won't be interactable, it just won't move.

    Code (CSharp):
    1.  
    2.     ScrollRect scrollRect;
    3.  
    4.     scrollRect = GetComponent<ScrollRect>();
    5.  
    6.     scrollRect.horizontal = false;
    7.     scrollRect.vertical=false;
    8.  
     
  5. Sparkline

    Sparkline

    Joined:
    Feb 8, 2013
    Posts:
    121
    GetComponent<ScrollRect>().enabled = false;