Search Unity

Unity UI can't click UI Buttons inside canvas -> panel -> buttons

Discussion in 'UGUI & TextMesh Pro' started by mauryavivek33, Jan 6, 2019.

  1. mauryavivek33

    mauryavivek33

    Joined:
    Jan 6, 2019
    Posts:
    2
    I have done all kind of setting like graphic raycast and interactable but it still cannot be clicked
    I want to click upgrade button which is world space canvas
    Here, the panel's name is Buttons
     

    Attached Files:

    Last edited: Jan 7, 2019
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hi @mauryavivek33

    Really hard to say, but you seem to have multiple canvases, and the one you have problem with (the selected one in hierarchy) is topmost; You could have something blocking the button, your other canvas might have different/higher sorting order than your button's canvas and if it has a panel (for example) over button, this will make the panel block the button in another canvas.

    Try disabling all other canvases, check for panels overlapping button, disable all canvas groups if you have those (might be set block raycasts).
     
  3. mauryavivek33

    mauryavivek33

    Joined:
    Jan 6, 2019
    Posts:
    2
    Actually, I have figured out.
    I just have to set the 'Event Camera' in canvas component to 'Main Camera'
     
  4. mikeownz

    mikeownz

    Joined:
    Mar 3, 2017
    Posts:
    21
    Thanks for posting the answer to this. This was driving me nuts!
     
  5. tra_tra_tra

    tra_tra_tra

    Joined:
    Nov 6, 2020
    Posts:
    1
    Bruh! Ive been trying to fix this for hours. Thank you so much. If its helpfull for anayone else, I also changed the render mode, to World Space in the canvas inspector and clipping planes to 0 in the camera inspector. Im currently building an UI.