Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Vickylance · Dec 28, 2014 at 10:34 AM · uibuttonbugunity4.6

My button is dead forever even though the interactable is checked. Bug in Unity?

The button is just frozen and I think its because of a function I attached to the script but what even when I reset the Button component on that button it is still frozen. I am calling it frozen because unlike other buttons it is not dimming when I click and hold on it and also it is not working even though I attach a good working function to the OnClick event. It is still dead and the only round about is delete the button and recreate it ,but again when I attach the previously told function and run it again it works once but the next time (sometimes it is working for a couple of times),it is dead again and forever no matter what ever I reset in that button.

I actually think this is a bug in unity... please confirm.

And ya the code is here...

 public void SaveState()
     {
         newGame.GetComponent<Canvas> ().enabled = !newGameState;
         newGameState = !newGameState;
         characterCreation.GetComponent<Canvas> ().enabled = !characterCreationState;
         characterCreationState = !characterCreationState;
         headCust.GetComponent<Canvas> ().enabled = !headCustState;
         headCustState = !headCustState;
         hairCust.GetComponent<Canvas> ().enabled = !hairCustState;
         hairCustState = !hairCustState;
         eyesCust.GetComponent<Canvas> ().enabled = !eyesCustState;
         eyesCustState = !eyesCustState;
         nextAndBackBtn.GetComponent<Canvas> ().enabled = !nextAndBackBtnState;
         nextAndBackBtnState = !nextAndBackBtnState;
     }

Savestate is the function I attached to the button.

newGame,characterCreation,headCust,hairCust,eyesCust,nextAndBackBtn are all just canvases which I am enabling and disabling the canvas component(this method is working for other buttons which I have coded in a same way)

I am using unity4.6 not the beta but the stable version.

Comment
Add comment
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

1 Reply

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

Answer by Mmmpies · Dec 28, 2014 at 10:50 AM

The new UI is good but as panels and other objects can be invisible but still block raycasts it can hide a button behind another transparent panel.

Move the button to the bottom of the list of UI elements if possible, the order of UI is top == back bottom == front so moving the button down should move it in front of the other objects.

If that fixes it you probably still need to work out which panel or text or really any UI element was causing the issue.

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 Vickylance · Dec 28, 2014 at 04:08 PM 0
Share

I deleted all my child canvases and replaced them with panels and now it is working :)

avatar image jakovd · Dec 28, 2014 at 04:10 PM 0
Share

Then mark the answer as accepted and let's move on. ;)

avatar image Vickylance · Dec 29, 2014 at 08:07 AM 0
Share

Sorry about that now I have marked it :)

avatar image Mmmpies · Dec 29, 2014 at 08:48 AM 0
Share

That's O$$anonymous$$ @Vickylance thanks for getting back to me and thanks @jakovd

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

A button inside of a button is highlighting parent button 1 Answer

UI buttons disable when building for Windows. 0 Answers

Override sorting not working? The canvas just freezes………zzzzz 0 Answers

Почему после перехода на другую версию Unity при создании кнопки она не откликается на геймпад и клавиатуру? 0 Answers

IPointerClickHandler on mobile not working? 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