Search Unity

Overlay Canvas blocks World Space Canvas

Discussion in 'UGUI & TextMesh Pro' started by deLord, Nov 17, 2014.

  1. deLord

    deLord

    Joined:
    Oct 11, 2014
    Posts:
    306
    Hi

    I use a normal and a world space Canvas. But it seems my normal Canvas blocks world space buttons. How can I change this? I tried setting the world space buttons to my own layers but that had no effect. Also I tried a lot else but I couldn't notice any effect. When I disable my normal Canvas, it works.
     
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    i'm not following what you're saying... whats a normal canvas? what do you mean blocking your world canvas.
     
  3. deLord

    deLord

    Joined:
    Oct 11, 2014
    Posts:
    306
    With normal canvas I mean a canvas which has not been set to render mode World Space. The normal canvas which, once aligned, will always fit your screen, no matter what the camera does.
    With blocking I mean that I have the impression that clicks on the world space buttons are blocked by the non-world-space canvas (dont have the proper expression for that right now). Once I setActive(false) my canvas, I can click my world space buttons.
     
  4. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Does your overlay canvas (thats what the "normal" one is) have element overtop of the button you're trying to click?
     
    Maund likes this.
  5. deLord

    deLord

    Joined:
    Oct 11, 2014
    Posts:
    306
    Doesnt this depend on the resolution as well? In my ingame view, there is no element ontop my button. My buttons are kind of centered while my overlay canvas aggregates at the edges.
     
  6. deLord

    deLord

    Joined:
    Oct 11, 2014
    Posts:
    306
    OK there is some element on top of it, but the image of it is mainly transparent. What do I need to change to make it work?
     
  7. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    If there is a element on top then of course the event wont go through. you'd need to make one canvas not receive events.
     
  8. deLord

    deLord

    Joined:
    Oct 11, 2014
    Posts:
    306
  9. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Also wondering about this, once he finally understood your question no response... =P
     
  10. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    Remove the GraphicRaycaster on the canvas you don't want to receive events (or, if you only want to disable them for certain elements in that canvas, add a CanvasGroup component to those and disable "Interactable"/"Blocks Raycasts").
     
  11. jamius19

    jamius19

    Joined:
    Mar 30, 2015
    Posts:
    96
    Perfectly works for my case :D
    thanks :D
     
  12. zafer_celik

    zafer_celik

    Joined:
    Nov 11, 2021
    Posts:
    1
    I had the same problem but I cannot disable overlay canvas raycasting because i need it for joystick controller. Is there any other way that makes world canvas interact before overlay canvas interacts?
     
    Findeh and muhammad_ali_safdar like this.
  13. muhammad_ali_safdar

    muhammad_ali_safdar

    Joined:
    Jan 7, 2015
    Posts:
    15
    you got any solution ?
     
  14. SJ_de

    SJ_de

    Joined:
    Jan 24, 2020
    Posts:
    1
    I had same issue
     
  15. The-Lemur

    The-Lemur

    Joined:
    Jan 23, 2015
    Posts:
    3
    If anyone is still having this issue: If you have a panel (visible or invisible or other image covering your whole screen, make sure that "raycast target" is set to false on that component. This is generally good optimization advice.