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 khos85 · Jan 14, 2015 at 09:01 PM · joystick

How to find joysticks axises?

Hi,

I am creating a radio controlled flight sim, nearly finished, see some info here if interested: http://forum.unity3d.com/threads/rc-flight-sim-project.289046/

With Radio control you get these usb transmitters, see pic below, which are essentially joysticks.

alt text

I can see that the joysticks are are detected but I am not sure what axies to define, how can I find out which joystick axis is what with a device such as this? Any help would be much appreciated!

controller.jpg (30.7 kB)
Comment
Add comment · Show 1
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 khos85 · Jan 14, 2015 at 09:02 PM 0
Share

I meant to say how to define these or know which joystick axies they are in the Unity Input manager area..

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Mystigan · Jan 15, 2015 at 09:22 AM

Hey , I had the same issue with thrustmaster steering kit, After a bit of googling I stumbled on this Input Mapper master It worked for me maybe you can configure it for your controller as well :)

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 khos85 · Jan 15, 2015 at 12:23 PM 0
Share

Cool, I have looked at that but have no idea yet on how detect what my device is setup as, hope I can understand... thanks for this.

avatar image khos85 · Jan 15, 2015 at 10:19 PM 0
Share

Well , I had a look at your suggestion but seemed quite a lot to get into, I decided to debug my inputs and created a little test scene, then I mapped each axis one in some simple javascript by one until I had all correct, now I know what is what and I can use that in my real game. Thanks for the suggestion, much appreciated!

avatar image
0

Answer by jrocamora · Aug 27, 2016 at 02:23 PM

setup every possible axis in the input manager as "axis 0", "axis 1", "axis 2", etc. and then use this code on an empty gameobject to find which one your hitting. it will show up in the console, and also be stored during runtime in the array which you can look at in the inspector

 //these go up top
 public bool recentered;
 public string[] axes = new string[30];
 public int n;
     
 //start
 n = 0;
     
 //put this in your update
 for (int i = 0; i < 30; i++) {
     if (n == 0 || Input.GetAxis(axes [n - 1]) == 0) {
         recentered = true;
     }
 
     if (Input.GetAxis ("axis " + i) != 0 && recentered) {
         print("axis " + i);
         recentered = false;
         axes [n] = "axis " + i;
         n++;
     }
 }
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

27 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

Related Questions

how to make gameobject follow finger touch position within custom joystick 1 Answer

Error on build 2 Answers

C# Clamp joystick rotation 0 Answers

Why does pressing joystick button 0 also trigger joystick button 1? 1 Answer

late response mobile joystick crossPlatformInput 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