Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

2d TMP Button is not working

Discussion in '2D' started by LQPewds, Jul 24, 2021.

  1. LQPewds

    LQPewds

    Joined:
    Nov 12, 2020
    Posts:
    25
    My tmp button does not click. I saw a massive thread about this and tried EVERYTHING on it and it still doesn't work :(
     
  2. Wombat_Rancher

    Wombat_Rancher

    Joined:
    Jul 25, 2021
    Posts:
    6
    You need to provide some sort of context for us to be able to help you. Post the error message in the console, the code snippet you suspect to cause the bug or basically anything else to point us into the right direction.
     
  3. LQPewds

    LQPewds

    Joined:
    Nov 12, 2020
    Posts:
    25
    Theres no code or error message. Other than a debug.log I hooked up to check it. It just doesn't register the click
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,546
    For the future, please note that this is not the UI forum.
     
  5. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,319
    You probably lack Raycast Target = true. Or there is another UI element on top of it that is a raycast receiver and thus is blocking it.

    Another potential problem is your event isn't hooked up. Double check in the Inspector that it is. Another way to add an event is to go myButton.onClick.AddListener(() => SomeOnClickMethod());