Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Can't click UI Buttons

Discussion in 'Unity UI & TextMesh Pro' started by xFrost96x, Sep 14, 2016.

  1. xFrost96x

    xFrost96x

    Joined:
    Nov 7, 2015
    Posts:
    3
    Hi , why my button can't be pressed??

    Here is my screenshot:
     

    Attached Files:

  2. mikael_juhala

    mikael_juhala

    Joined:
    Mar 9, 2015
    Posts:
    247
    - Make sure the graphic has "raycastTarget" set to True.
    - Make sure the button has its "interactable" set to True.
    - If there's a nested canvas in the button's parent, that canvas also needs GraphicsRaycaster.

    If all those are fine, then start the game, select your EventSystem and click your button. At the bottom of the inspector you'll see what your click hit (in that dark box that is visible in the first screenshot). It might be something else capturing the click before the buttons.
     
  3. Shippety

    Shippety

    Joined:
    May 9, 2014
    Posts:
    24
    I added GraphicsRaycaster to the parent and it fixed my problem! Thanks so much!
     
  4. TinkersEdge

    TinkersEdge

    Joined:
    Oct 4, 2016
    Posts:
    6
    Thank you!!Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! I spent the last three hours looking for the reason why my buttons weren't working. I knew something had to be blocking them but couldn't figure what. You are the first and only person that I have found that game me an actionable way (besides going through every object in my scene) to figure out what was the problem. YAY!!!!:D
     
  5. freakymango1

    freakymango1

    Joined:
    Jan 15, 2017
    Posts:
    1
    EventSystem?
     
  6. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,715
    An event system should be automatically added to your scene when you add a canvas. If you need one for something else (and have no canvas), you can add it yourself. You can also add it yourself if you accidentally deleted it :)
     
    erikp93 and willersify like this.
  7. hungtv

    hungtv

    Joined:
    Jul 10, 2018
    Posts:
    1
    Awesome! Thanks, man.
     
  8. DOpeIncorp

    DOpeIncorp

    Joined:
    Aug 12, 2017
    Posts:
    2
    If your still having problems after doing the above I found that my problem was that in the buttons 'On Click ()' settings. I had set for the button to change the sprite in an image component although I had left the sprite reference equal to none. Make sure you guys haven't left out any references in the 'On Click()' settings.
    This is what the problem was:
    Capture.PNG
     
  9. SomeVVhIteGuy

    SomeVVhIteGuy

    Joined:
    Mar 31, 2018
    Posts:
    78
    Id just like to say be sure you have things "ordered" correctly in your manager. It looks like your buttons may be behind your panel.
     
  10. betaFlux

    betaFlux

    Joined:
    Jan 7, 2013
    Posts:
    42
    In my case I forgot that I had a canvasgroup component on the button's parent. The "Interactable" and "Blocks Raycasts" options have to be ticked to allow the interaction with the child buttons.
     
    Lukalotr likes this.
  11. canakgol

    canakgol

    Joined:
    Dec 5, 2018
    Posts:
    1
    here is my screenshots. I still can not click on UI button!
     

    Attached Files: