Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by M3TA6R055 · Sep 04, 2017 at 03:04 PM · uiscene

So my buttons stop working...

Yeah, I know other people had this problem, but none of their answers worked for me... I'm making a text based game, and on the Chapter Select screen, the buttons stopped working after I changed their highlighted color. It did it before when I tried to build the scene before, but that time the buttons stopped working when I changed their position on the screen.

Can anyone help? I've gotta get this scene complete so I can get to work on the actual levels.

Thanksalt text

I attached a picture of the screen, just in case.

unity.png (38.1 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MaxGuernseyIII · Sep 19, 2017 at 11:54 PM 0
Share

If someone gave you an answer that helped and now your code is working, why not accept their answer?

2 Replies

· Add your reply
  • Sort: 
avatar image
14
Best Answer

Answer by Hellium · Sep 04, 2017 at 03:43 PM

The easiest way to debug is to :


    1. Run the game in the editor, not in full screen (uncheck Maximize On Play button)

    2. Select the EventSystem GameObject of your scene

    3. In the inspector, open the Preview Window and make it big enough

    4. Move your mouse on your screen, and check if the name of your button (or one of its children) appear next to the field pointerEnter

alt text


If you can't see it, possible solutions :


   1. Make sure you don't have any UI elements above your button which could block the raycasts

   2. Make sure you have enabled raycasting on the images used by your buttons (check box Raycast Target in the edito)

Raycast target

   3. Make sure you have an Event System in your scene and a GraphicRaycaster attached on a gameobject (on the Canvas usually)

   4. Make sure your buttons are interactable (checkbox Interactable in the editor)

   5. Make sure you have a callback attached to your buttons so as to trigger your functions

   6. If your canvas is set to Screen Space - Camera or World space, make sure you have specified a camera

   7. If you have rotated / scaled UI elements, the click may not be detected. In this case, uncheck Ignore Reversed Graphics in the Graphic Raycaster component of the canvas, or set the rotation correctly of the element and use a rotated / scaled child image (with Raycast target disabled) in order to have the desired "graphical result"

   8. Check if you have a Canvas Group attached to the object or one of its parent, and make sure the Interactable and Blocks Raycasts are both checked.


eventsystem.jpg (60.0 kB)
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image M3TA6R055 · Sep 04, 2017 at 08:47 PM 0
Share

Thanks, It's working now!

avatar image RyanGamingKob · Oct 27, 2019 at 08:02 PM 0
Share

@Hellium Hey, I'm Late... I Checked The EventSystem, There Is A Panel Before $$anonymous$$y Buttons.. That's Why They Are Not Working... How Do I $$anonymous$$ake The Buttons Before THe Panel?

avatar image Hellium RyanGamingKob · Oct 27, 2019 at 08:07 PM 0
Share

Either uncheck the Raycast Target tickbox of the panel or reorganise your hierarchy so that buttons are drawn after your panel.

For example, if you have a hierarchy as follow

 GameObject1
     └ GameObject2
           └  Button 1
           └  Button 2
 GameObject3
     └ Panel

Change the hierarchy like this

 GameObject3
     └ Panel
 GameObject1
     └ GameObject2
           └  Button 1
           └  Button 2
avatar image
0

Answer by DiegoperezB · Dec 30, 2020 at 08:17 PM

I know this is already answered but i had another similar problem that i already solved, so i am going to show for someone that may have the same problem.

Problem: In one of my projects i had a UI with buttons that was enabled and visible all the time. It worked well except for when my character started walking, then the button didn't work. Solution: I realize it was a problem with the pointerEnter, i tried many solutions that didn't work but in the end the solution was to change the Canvas render mode to 'Screen Space - overlay' i am not sure why but it was fixed then.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

127 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make buttons have sound when it is highlighted and clicked? 0 Answers

SVG Image quality when imported to UI is bad. 0 Answers

Is there a way to activate a timer from another scene? 1 Answer

How can I get a list of all scenes in the build? 6 Answers

How to Load PlayerPrefs from a different scene 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges