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 TheYokai · Oct 28, 2014 at 05:32 AM · inputaxisjoysticks

KeyCode equivalents to Axis (Joystick)

I need to rewrite Unity's input management system due to Unity's current implementation being too static and generally being poor at handling user binding / multiple player configurations. Being able to detect and bind user button inputs will be simple, since fetching specific button inputs is as simple as calling:

  GetKey( Keycode.[Bound Button Here] )

However, there doesn't seem to be an equivalent for Axis. I want to avoid using the InputManager class yet need to find a way to ask specifically for Joystick 1's (or any up to 4) axis state.

Is there a way to fetch Axis information about a specific controller similar to the GetKey method above? Or is there any way generically fetching information about joystick axis?

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
2
Best Answer

Answer by Bunny83 · Oct 28, 2014 at 05:48 AM

No, there isn't. The only solution is that you setup a seperate axis in the input manager for every possible axis / joystick combination you want / need to support. Then you can read them as you wish. If you want to support all axes you need to setup only 220 axes :P

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 TheYokai · Oct 28, 2014 at 06:05 AM 0
Share

Honestly? What a pain...

I suppose I could settle with generic names like "Joystick [0 - 4] Axis [1 - 8]" and make it so that users can bind specific "strings" which represent those in the Unity Input$$anonymous$$anager? That way users can just bind whichever axis they need to / want to use?

I really wish this Input system was better thought out though. $$anonymous$$y experience with SDL2 is actually easier and really blows this system out of the water. Why don't they just use that ins$$anonymous$$d of reinventing the wheel? Idk, their call though.

avatar image Bunny83 · Oct 28, 2014 at 06:19 AM 1
Share

Well, the input manager has been like this since, well, since i started using Unity years ago ^^ (Started with 2.6). Eric5h5 posted a feature request in 2009. If you haven't already used up your votes, feel free to vote it up ;)

If we could finally access the Input manager via an API, you could define new axes on the fly.

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

29 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

C# HUD axis button display 0 Answers

Read analog stick input without using the Input Manager 1 Answer

Detect Gyroscope's rotation around a single axis? Like a car game. 0 Answers

Does unity support a 16 bits axis input? 0 Answers

UnityException: Input Axis Rotate2 is not setup. 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