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
1
Question by steve85uk · Apr 09, 2015 at 10:05 AM · guimenuxbox

Xbox Controller and Unity 5 menu

I'm trying to control a menu with an xbox controller. Any idea how to do this?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
8

Answer by nonathaj · Apr 09, 2015 at 11:39 AM

You are going to want to check out the Event System and UI element Navigation.

When you add a UI element or canvas to the scene/hierarchy, Unity automatically adds an object for the EventSystem that will look something like this in the inspector:

alt text

This object contains a few scripts, including one for the Standalone Input Module. This defines what axes and buttons are used for navigation within the canvas's navigation. These axes and buttons are directly from the Input Manager, so you may need to set up new axes for your controller in the Input Manager.

By default the Unity input manager is not set up to support the Xbox 360 controller. You can use this wiki page with the Xbox 360 controller axis and button mappings to help you get your axes and buttons set up how you like them.

I really recommend Unity's tutorial video on the Event system if you are new to using the UI system's events. It does a thorough job of explaining how to connect elements and navigation between them works.


eventsystem.png (29.6 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
4

Answer by fadden · May 19, 2016 at 10:40 PM

Unity 5 is more or less ready to go as far as the Xbox 360 controller goes, but you'll need to do a little work in your UI code.

The trick is that you have to select an object before anything will work. If you have just one screen of buttons in your scene, you can drag the first button into the "First Selected" field of the "Event System (Script)" section of the EventSystem object that is auto-added by Canvas. If you have additional screens, you'll need to tell the UI system where to start.

The method to use is Selectable.Select() (which currently has the awesomely accurate description, "Selects this Selectable"). UI Button objects are Selectable. Once you call this, the navigation system will have a starting point, and moving the controller joystick will move the selection around.

To change the way the selection moves, play with the Navigation settings on the UI Buttons.

(FWIW, I've found that you can select a button manually while playing in the Unity Editor by putting your mouse pointer on the button, clicking the mouse, moving the pointer off of the button, and then releasing the mouse button. Do that, and you should then be able to navigate the current screen with the controller and 'A' button, as well as the arrow keys and space bar.)

See also this question.

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
0

Answer by Slazen7151 · Nov 18, 2017 at 04:09 AM

Maybe you can try using store assets: https://assetstore.unity.com/packages/tools/gui/imenu-intelligent-menu-for-ugui-85917

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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Main Menu - One scene or multiple? 1 Answer

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

How to make a 2d gui that can go down?? 1 Answer

How do i make a menu close if i open another menu 1 Answer

Positioning Context Sensitive Popup Menu Using 4.6/5 UI system 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