Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Solved] UI Button not working at all

Discussion in 'UGUI & TextMesh Pro' started by Sargaxon, Aug 25, 2016.

  1. Mamta_kh

    Mamta_kh

    Joined:
    Nov 1, 2019
    Posts:
    2
    I solve it, Actually some transparent panel was blocking it.
     
  2. Freddy03060

    Freddy03060

    Joined:
    May 1, 2020
    Posts:
    1
    If you have created something like a pause menu then make all over canvases disabled whilst within the Pause Menu using (Canvas Name).SetActive(false); Make sure to Reference the canvas as a game object if your new to unity :)
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    3,853
    I solved mine by deleting all canvas in parents of the button. Why did the canvas block raycast in the first place? I have no idea.
    I was using canvas to group batches and with them gone now nothing batches according to the frame debugger.
     
  4. AlterContacts

    AlterContacts

    Joined:
    May 18, 2020
    Posts:
    1
    Definitely a bug. I have done A/B testing and makes no sense whatsoever
     
  5. perkays

    perkays

    Joined:
    Jul 10, 2020
    Posts:
    2
    canvas > set order > 1
     
  6. ColtPtrHun

    ColtPtrHun

    Joined:
    Nov 20, 2019
    Posts:
    6
    Hi everyone!

    I had the same problem, and for me the solution was to look for the EventSystem in the hierarchy. There is a Standalone Input Module which I disabled because it always creates additional inputs in the input manager which is quite annoying. However as soon as I reenabled it, the buttons worked...

    -Peter
     
    Mario-M701 likes this.
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    3,853
    This might be the most accurate solution. Show us your hierarchy.
     
  8. codemaker2015

    codemaker2015

    Joined:
    Aug 19, 2018
    Posts:
    12
    Don't forget to add EventSystem in your scene. If the scene doesn't have any event trigger is not able to track any events that's happening in the scene
     
  9. codemaker2015

    codemaker2015

    Joined:
    Aug 19, 2018
    Posts:
    12
    Ensure that the scene contains EventSystem
     
  10. unity_LRx7qc-qvF-sqg

    unity_LRx7qc-qvF-sqg

    Joined:
    Oct 1, 2020
    Posts:
    1
    oh yes i deleted it thinking that it not needed to me i feeling self as idiot
     
  11. Ar3max

    Ar3max

    Joined:
    Aug 6, 2019
    Posts:
    1
    Before Changing Any Settings or adding Anything, DO THE FOLLOWING:-
    1. Create an Empty Project.
    2. Right Click in Hierarchy and from UI, select Button.
    3. Play The Scene and Check if the Button is working or not.


    Point1:- If the Button is Working, that means you have done something wrong in your Project(where it's not working).
    In that case, follow the solutions provided by others. One of them might surely work.

    Point 2:- If the Button is not working, then that means Your Unity Editor has some bugs or You did something (unknowingly) which caused the UI's not work.

    Solution: If your case is Point 2, then I guess nobody know how to fix it, or if Someone knows, then he didn't shared it.
    The Only thing You can do is Upgrade Your Unity Version.

    The Problem Happened to my Unity 2020.1.4f1. I tried all the solutions(from different forums), but nothing worked.
    Then I decided to change the Unity Version to see if works or not.
    I opened UnityHub>Installs>Add, there I was about to install the Recommended Released LTS version, but then I saw there is a Pre-released Alpha Version Unity 2021.
    I installed it(cause I wanted to) and when I opened that same Project in this alpha version. The Problem is just gone.

    * Since I got the solution in my first attempt, I didn't bother to install any other version. But I am pretty much sure changing to any other version will work.
    * Remember I installed another version from UnityHub, not from Unity Edtor>Help>Check for Updates.
     
unityunity