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 /
  • Help Room /
avatar image
0
Question by danny1111 · Mar 22, 2016 at 01:43 PM · buttonwrong

Wrong button is pressed

I have 4 buttons (1,2,3,4) but only two of them work. When I press 1, the 2 button lights up green and when I press 3, the 4 button lights up green. Also, I've tried making the 2 and the 4 inactive and the 1 and the 3 now works so why does it not work with them.alt text

answersunity.jpg (42.8 kB)
Comment
Add comment · Show 7
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 danny1111 · Apr 09, 2016 at 06:06 PM 0
Share

Please!!! I really need an answer because the game is nearly finished and I want to publish it as soon as possible.

avatar image BenAshleyTucker danny1111 · Apr 09, 2016 at 10:50 PM 0
Share

Would you be able to explain in a bit more detail? Thanks

avatar image danny1111 BenAshleyTucker · Apr 12, 2016 at 06:23 PM 0
Share

It's quite difficult to explain. When I try to click on the 2, the 3 lights up etc. Even when I clicked on the left hand side of the 1 (the black screen) the 1 lights up. I've checked and rechecked the code and there's definitely nothing wrong there.

avatar image TreyH · Apr 12, 2016 at 06:31 PM 0
Share

Are these buttons tied to functions in a script somewhere?

avatar image danny1111 TreyH · Apr 12, 2016 at 06:35 PM 0
Share

Yes. In the script it says. public void removeOthers(){ foreach(GameObject i in greens){ i.SetActive(false); } } public void changeColour(){ greens [0].SetActive (true); PlayerPrefs.SetInt("multiply",1); } public void changeColour1(){ greens [1].SetActive (true); PlayerPrefs.SetInt("multiply",2); } public void changeColour2(){ greens [2].SetActive (true); PlayerPrefs.SetInt("multiply",3); } public void changeColour3(){ greens [3].SetActive (true); PlayerPrefs.SetInt("multiply",4); } When I click one of the buttons, it calls the RemoveOthers function then the changeColour one depending on which one I pressed. Sorry the code's difficult to see as a comment. I can put it as an answer if you like.

avatar image danny1111 · Apr 29, 2016 at 06:42 PM 0
Share

I finally solved it!!! Basically the text of the numbers were wildly too high (560) and for some reason made it all go wrong so I made the height smaller and it works perfectly.

avatar image Huwngg1611 · Oct 06, 2019 at 07:02 AM 0
Share

Hi Danny, Im beginner in Unity. I have same problem and dont know how to fix it. Did you find the answer or any solutions for this? thanks you

0 Replies

· Add your reply
  • Sort: 

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

6 People are following this question.

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

Related Questions

Is it possible to use a GUI Button (On Click) to force Input keyboard commands like spacebar for Jump? 2 Answers

If I export my Android game as a 'Google Android project' and open it in Android Studio, can I get Unity UI button event in Android Studio? 0 Answers

Blend Cubemap Skybox Shader to Panoramic Shader 0 Answers

OnTriggerEnter and UI button 2 Answers

UI Jump Button - I want to click on the button to jump but instead I jump when I click anywhere on the screen. 0 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