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
4
Question by NinjaSlayer · Aug 24, 2015 at 02:37 PM · uibutton

UI Button stays highlighted after click

I've made a UI button with its transition state set to "Tint" and I can click it and call a function from its OnClick() event list. It generally seems to work as expected except for one small visual annoyance; after clicking the button, it remains in its highlighted state until I click somewhere else in the scene.

Anyone know why the button will not automatically return to the 'Normal Color' tint after the button is clicked and instead stays stuck on the 'Highlighted Color' state?

Or, does anyone know which class I can use to grab a reference to the button from inside the script being called from the OnClick() event list so I can force the UI button back to its default state?

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 NinjaSlayer · Aug 27, 2015 at 05:03 PM 1
Share

It seems that this was already answered here, don't know how I missed it when searching previously. The solution there also works for Unity 5.

1 Reply

· Add your reply
  • Sort: 
avatar image
19

Answer by koekeritis · Oct 19, 2015 at 08:47 PM

Change the navigation to 'none' on the button component, it's a bug with Unity's keyboard menu navigation.

Comment
Add comment · Show 4 · 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 DominoOne · Apr 08, 2016 at 08:11 AM 1
Share

This works great for the issue described. But if you press the mouse down and drag it out of the button (while still pressed), the button will become highlighted until the mouse is released (and on top of that, if you enter another button while the mouse is still pressed, then release the mouse on top of that other button, the button won't become highlighted, even if the mouse is hovering on top of it). Any idea how to work around this?

avatar image tswiggs · Apr 30, 2017 at 04:30 PM 0
Share

@Do$$anonymous$$oOne I'm still seeing this issue a year later. Were you able to find a solution or did you just roll your own button script?

avatar image DominoOne tswiggs · Oct 03, 2017 at 01:49 PM 0
Share

I don't think we actually solved it, we probably just left it alone (it's not something that breaks a game).

avatar image HosseinArabbeigi · Aug 27, 2019 at 08:02 AM 0
Share

Thanks @koekeritis! great answer!

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

7 People are following this question.

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

Related Questions

Unity UI Button 1 Answer

How To Change Color Of Text On UI When It's Selected | Unity 4.6 3 Answers

UI Button deletes Function on start 1 Answer

How do I check if a UI button is pressed within an if statement? 1 Answer

Unity UI Button Switch Bool? 2 Answers


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