Search Unity

Block uGUI scroll with overlay

Discussion in 'UGUI & TextMesh Pro' started by Orimay, Jun 13, 2015.

  1. Orimay

    Orimay

    Joined:
    Nov 16, 2012
    Posts:
    304
    How do I create uGUI overlay with elements, that will block all underlying elements (including scroll area)?

    I have something like a popup, that has to be closed on overlay click. There is a scroll area behind. The problem is that scroll appears while interaction with popup. I need popup to ignore everything under overlay.

    What I have done: I have disabled GraphicRaycaster on the root Canvas and added new GraphicRaycaster on the overlay. Also, Overlay Canvas overrideSorting option enabled.

    Thanks in advance!
     
  2. KazYamof

    KazYamof

    Joined:
    Jun 26, 2015
    Posts:
    59
    If i got it right, maybe a CanvasGroup will help, if you use his Blocks Raycasts property.
     
  3. Orimay

    Orimay

    Joined:
    Nov 16, 2012
    Posts:
    304
    Thanks, I'll try it. Though I think, I already did it :)
     
  4. Orimay

    Orimay

    Joined:
    Nov 16, 2012
    Posts:
    304
    Thanks, but no, it does not help at all.
     
  5. douglasg14b

    douglasg14b

    Joined:
    Oct 2, 2014
    Posts:
    34
    Hey Kender, could make a mockup image of what you are trying to accomplish? I may be able to help.
     
  6. AwDogsGo2Heaven

    AwDogsGo2Heaven

    Joined:
    Jan 17, 2014
    Posts:
    102
    I've encountered this issue too. He merely wants to prevent the user from scrolling, like for example when a popup appears. I don't think there is a way to do this with Canvas Group unfortunately, as it appears the interactable field doesn't affect it. You might have to write some custom scripts, at least thats what I plan on doing.