Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Buttons not working, Help

Discussion in 'UGUI & TextMesh Pro' started by Nocturnal_Carrot, Feb 9, 2024.

  1. Nocturnal_Carrot

    Nocturnal_Carrot

    Joined:
    Feb 3, 2024
    Posts:
    3
    I'm now trying to develop my first game (Just a copy of Flappy Bird), and I'm trying to add a button to restart once I hit the obstacle. I've set the highlight color to red, and the button doesn't even get highlighted when I hover over it, and when I click it, it doesn't do anything at all.


    Here's a screenshot of my button settings: Screenshot 2024-02-09 111829.png
     
  2. Nocturnal_Carrot

    Nocturnal_Carrot

    Joined:
    Feb 3, 2024
    Posts:
    3
    If you're wondering, the script "Restart" is a public method that loads the current scene using the SceneManager, it is not the problem, I've tested it with a collision and the script works, it's the button that doesn't work.
     
  3. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,040
    do you have an eventsystem?
     
  4. Nocturnal_Carrot

    Nocturnal_Carrot

    Joined:
    Feb 3, 2024
    Posts:
    3
    Thanks, it works now