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 mdagreda · Jan 23, 2015 at 05:12 PM · uibuttonmenuselection4.6

Button is not selectable when pressing the submit button even though it is highlighted. How do I fix that?

So I have a menu that pops up and I am assigning one of the buttons to be the currently selected on via script and that button appears highlighted. Now when I press the A button on my controller which I have set up as the submit button the button does not get pressed. I have to move the analog stick on the controller to another option on the menu before the input will start working. This means to select the first option in the menu I have to move the analog stick in one direction and then back to the first option for it to work. Any ideas on how to fix this or what is going on?

Comment
Add comment · Show 6
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 carrollh · Jan 23, 2015 at 05:16 PM 0
Share

What are you doing to "select" it? If you draw a thing above it that is transparent I know you won't be able to click on it. Can you show us the code? And maybe explain the heirarchy a bit. A picture would be good.

avatar image mdagreda · Jan 26, 2015 at 07:49 PM 0
Share

there is nothing above it. I am making it the active button through code such as this main$$anonymous$$enuEvents.SetSelectedGameObject(titleButton, new BaseEventData(main$$anonymous$$enuEvents));

what I am doing to get rid of an the stuff that would be drawn above it is setting those game objects to be not active anymore.

I am able to click the button easily with the mouse but even through the button is highlighted and the submit command is mapped to the A button on my controller, pressing A will not make send the click command until I move the joystick a little.

avatar image Mmmpies · Jan 26, 2015 at 08:07 PM 0
Share

If using your controller then I guess you're not doing a mouse click or touch action. The button is effectively not needed but I guess you want to show it being clicked. If so then just reference the button in the script you record the controller being clicked and change the color of the button briefly.

avatar image mdagreda · Jan 26, 2015 at 08:29 PM 0
Share

Well i want to use the buttons because I'm using the new gui system and the navigation is nice for moving between the buttons. The problem is that the joystick has to be moved before I can actually cause one of the events to occur on the button that I set up. I have tried the on click event as well as the submit event but both has the same results

avatar image Mmmpies · Jan 26, 2015 at 08:43 PM 0
Share

I think you're missing the point of the new UI it simplifies thing's for where you need to use pointer (finger or mouse) but for what you're doing you just need to record the click on the controller and provide a visual reference that it has been clicked.

I dare say there's a way to pass it a click but you really don't need to you can pass back the selection via code, that's what you'd do with the event system but no need to involve the event system if using a controller. You're just adding work for yourself which is the opposite of what the Event System should be. You can still use the navigation system to show which is selected.

If you really want to use it this way I'll see if I can work how to pass via code an OnClick but just "flashing" the button to show it's been clicked is plenty good enough for your setup. You can pass the code you'd implement in the OnClick via the code you record the controller click.

Let me know if you need any help with any of it.

Show more comments

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

21 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

Related Questions

Unity 4.6 Beta Controller Menu Button Movement 0 Answers

Unity 4.6 button movement problem 1 Answer

How to make a menu controled from Keyboard and using buttons? 0 Answers

Change the position of a UI component through pressing a UI Button 1 Answer

Use buttons to change string on other object 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