Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
6
Question by Xetosphere · Mar 01, 2015 at 09:58 AM · guimenukeyboardkeyboard input

Navigating a gui with the keyboard

Hi, I am trying to make a menu for my game using the new Unity UI system implemented in version 4.6. I want this to work with both mouse and keyboard but I don't know enough about the ui system yet to understand how to do this.

What I am trying to do is when you press the up or down key you will select the different buttons in the menu and when pressing enter or space it will "click" that button. Is this something that can be done without too much fiddling.

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

2 Replies

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

Answer by Mmmpies · Mar 01, 2015 at 10:21 AM

You need to look at the Navigation part of the buttons. set it to automatic and it should take care of an easy set of buttons.

ButtonNavigation

I've got mine set to none because I don't want the HUD buttons reacting the player movement but you can just play with the settings, Automatic will probably fix what you want instantly though.

Click on visualize and it'll show arrows on the canvas displaying which button links to which.


buttonnavigation.png (2.3 kB)
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
avatar image
20

Answer by Rolum · Mar 02, 2015 at 03:08 AM

Check the EventSystem that was created along with your canvas, you can drag a button on "First selected" to make sure you won't have to click with the mouse before being able to move around with the keyboard.

Comment
Add comment · Show 2 · 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 MagicStyle · Oct 31, 2017 at 12:39 AM 1
Share

Wow, I feel like a complete idiot now, after working a week only for scripting the menue. I should have read this earlier :/

avatar image Paratrooper82 · Jan 25, 2018 at 10:47 PM 0
Share

What if I made a pause screen and didn't use a canvas? Do you know how that would work? Basically my pause menu has three buttons, but no canvas, and the menu works fine, but I can't navigate through the buttons without a mouse.

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

Controlling Pause Menu with Keyboard 2 Answers

Main Menu - One scene or multiple? 1 Answer

How to place/add a HD image/picture in background of my game? 0 Answers

Using keyboard with the GUI system 2 Answers

How to make a 2d gui that can go down?? 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