Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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 /
  • Help Room /
avatar image
1
Question by TacoMakerMan · Nov 14, 2016 at 11:06 AM · inputcontrollerjoystickbuttonsstuck

Unity thinks I'm holding up and left on a joystick

So since this has been happening for a while to all the unity games that I have bought from steam, where the character would just walk forward and left without my input, I decided to open up Unity Editor and make a scene with a ball in it and make it roll according to the user input, and then I wrote the code to output to the console whether the user is pressing left, right, up or down:

 float moveHorizontal = Input.GetAxis ("Horizontal");
         float moveVertical = Input.GetAxis ("Vertical");
 
 string s = "";
         if (moveHorizontal == 1)
             s += "right";
         else if (moveHorizontal == -1)
             s += "left";
         else
             s += "none";
 
         if (moveVertical == 1)
             s += ", up";
         else if (moveVertical == -1)
             s += ", down";
         else
             s += ", none";
 
         Debug.Log (s);

And sure enough, the Console outputs: "left, up" and the ball rolls forward and to the left whenever I'm not holding any buttons.

I found out that it's the second Horizontal and Vertical Axes in the input manager that's causing it, which is the horizontal and vertical axes on a controller.

I have no idea how to solve this problem without disabling those inputs, and also why this is carrying through to any Unity-made steam games that I've bought. If anyone could help, that would be great.

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 Naphier · Nov 14, 2016 at 10:57 PM 1
Share

Something is up with your controller by the sound of it. What kind of controller? Try to reinstall or update its drivers. If it has a diagnostic utility then check that out. I had similar happen with my logitech controller and just threw it out because it was junk.

3 Replies

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

Answer by TacoMakerMan · Nov 14, 2016 at 11:12 PM

Okay so, I decided to go into my device manager, disable all of my controller drivers and restart my computer, and the problem went away, so I re-enabled them one by one and found out that is was being caused by a driver called "HID-Compliant game controller."

I don't know why this was causing a problem but it worked anyway.

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 UNDERHILL · Nov 15, 2016 at 06:16 AM

Historically in the computing world, sometimes, if you have your controller stick pressed in a direction when you plug it in or boot sometimes this will cause issues with the startup calibration (if any) and it will constantly seem to be in action though the sticks are in center.

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 bbonard · Dec 07, 2021 at 08:40 AM

Thanks a lot @TacoMakerMan for this thread and answer, I had exactly the same issue and did not tackle it before starting making a game...

I think it would be interesting to make the game more resilient on those kind of issues. But as a noob, I don't really know how.

Would it be possible to blacklist all inputs by default and create a whitelist of those you want ? Whitelist that could be updated in a "controls" menu section ?

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

86 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

Related Questions

Xbox Controller Input doesn't always go back to 0 1 Answer

How can I listen for input from all joystick axes through c sharp code? 0 Answers

Contollers are unusable when already plugged in when starting build/editor 0 Answers

Help needed with menu navigation. 0 Answers

Getting Raw Input Data From Controller 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