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 el-RERS · Jul 03, 2018 at 06:52 AM · inputcontrolleraxisxboxhorizontal

The value of Input.GetAxis("Horizontal") gets stuck when Xbox controller is disconnected...

Hello everyone, big problem here with Unity 2018.1:

So my game can be controlled with either a keyboard or with an Xbox controller. I want to give my players the option to disconnect the xbox controller and continue playing with the keyboard if they wanted to, the problem is, if the player happens to disconnect the controller while still pushing the left stick in the X Axis, the value of Input.GetAxis("Horizontal") gets stuck and there is no way to get it back to zero unless the controller is reconnected.

I already tried with Input.ResetInputAxes(), this will indeed, cancel all button presses in the controller, but only returns Input.GetAxis("Horizontal") back to zero for one frame, after it, it returns to the value in which it was stuck on...

Is there any way for a disconnected controller to stop giving value to Input.GetAxis("Horizontal") ??

Thanks in advance!

Comment
Add comment · Show 4
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 el-RERS · Jul 06, 2018 at 06:43 AM 0
Share

Just realised the same thing happens in both axes, Horizontal and Vertical. Does nobody have any idea? This is driving me crazy :(

avatar image hexagonius · Jul 06, 2018 at 07:13 AM 0
Share

Sounds like a bug to me, you should report it.

avatar image tormentoarmagedoom · Jul 06, 2018 at 10:03 AM 0
Share

Im not sure but i think you can chek if there is any controller connected, so you can code different things when is connected and when is not

avatar image el-RERS · Jul 06, 2018 at 04:12 PM 0
Share

thanks for the comments... unfortunately knowing when the controller is disconnected wouldn't help me when using the Input.axes on menus (Eventsystem and the Standalone Input $$anonymous$$odule uses the axis that gets stuck)

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

109 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 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

Input for bluetooth controller? 0 Answers

Read analog stick input without using the Input Manager 1 Answer

Input Fields using an Xbox One Controller 0 Answers

360 Trigger Pressing both Triggers at the same time 1 Answer

How to have multiple types of controller input using the input manager 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