Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 CrocsxG · Jan 15, 2018 at 05:01 PM · inputcontrollerjoystick

Unity only read the first connected Controller's input

Hello,

I am having big trouble with inputs, although I thought having implement all correctly...

Here is my actual problem, I have a simple script that do that just in order to see if the controller works

 public class InputManager : MonoBehaviour
 {
     public const float MAX_CONTROLLER = 2;
     public List<int> assignedController = new List<int>();
     void Update()
     {
         CheckNewController();
     }
 
     void CheckNewController()
     {
         Debug.Log("Joy1Start " +Input.GetButton("Joy1Start"));
         Debug.Log("Joy2Start "+Input.GetButton("Joy2Start"));
         for (var i = 1; i <= MAX_CONTROLLER; i++)
         {
             if (assignedController.Contains(i))
                 continue;
 
             if (Input.GetButton("Joy" + i + "Start"))
             {
                 Debug.Log("Add new player on controller" +i);
                 assignedController.Add(i);
             }
         }
     }


I have my Unity Input setup like this alt text

And a white a black XBOX One controller.

Now, if I put the black controller first then the white, my Debug.Log("Joy2Start ") fire and the other is always false. no matter which button I press If I do the opposite, and plug the white first, then I have Debug.Log("Joy1Start ")and same Joy2 stay stay false...

I guess I am doing something wrong, but I can't see :x

Can you enlighten me ?

Thanks

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 agray427 · Jan 15, 2018 at 05:25 PM 0
Share

I don't like using Unity's built-in input system when dealing with multiple controllers. It got to me too when I first started. I came across a plugin when I started called XInputDotNet which is for PC and Xbox 360 controllers. I don't see why it wouldn't work for Xbox One as well. Here is a link: https://github.com/speps/XInputDotNet. It's really well done in my opinion. It does actually use Unity's Input System though, but it handles everything for you.

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

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

Related Questions

Problems with joystick / controller axes being 1/-1 "way too often" 1 Answer

How do you properly deal with analog joystick input on multiple controller inputs? 1 Answer

Implementing a virtual joystick with mouse 1 Answer

How do I check what input device is currently beeing used? 4 Answers

problems moving game object with the right joystick 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