Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xbox Controller buttons not registering, but analog axes are? #19

Closed
Penthee opened this issue May 12, 2016 · 4 comments
Closed

Xbox Controller buttons not registering, but analog axes are? #19

Penthee opened this issue May 12, 2016 · 4 comments

Comments

@Penthee
Copy link

Penthee commented May 12, 2016

Hey there, I've been using InputManager for quite a while now and have never had much of a problem with it, I recently updated the plugin in my Unity project and have attempted to set up controller support for our game.

It's mostly going okay, I've got the analog sticks and triggers working fine, but none of the buttons or bumpers are working. No errors, just the Axes do not return a value.
I'm not really sure what I could be doing wrong, as I suspect that it's me rather than an issue with the code. I've tried numerous input configurations (almost everything I could think of), all based off the default files.

Any ideas? I can give you a copy of the project if you wish.

Also, while I'm here - I've got a small issue with the InputAdapter where it breaks on initialisation if the gameobject is enabled straight away - a workaround is to enable it a second after the scene has loaded but this seems a bit hacky. It throws the following:
NullReferenceException: Object reference not set to an instance of an object TeamUtility.IO.InputMgr.SetInputConfiguration (System.String name, PlayerID playerID) (at Assets/Scripts/Utils/InputManager/Source/Runtime/InputManager.cs:639) TeamUtility.IO.InputAdapter.SetInputDevice (InputDevice inpuDevice) (at Assets/Scripts/Utils/InputManager/Addons/InputAdapter/Runtime/InputAdapter.cs:597) TeamUtility.IO.InputAdapter.Awake () (at Assets/Scripts/Utils/InputManager/Addons/InputAdapter/Runtime/InputAdapter.cs:445)

@daemon3000
Copy link
Owner

For the first issue I need you to create a new project and try to replicate the issue there. If you can replicate it there send the project to me so I can debug it.

For the second issue make sure the InputManager script is first in the script execution order(Edit/Project Settings/Script Execution Order).

@Penthee
Copy link
Author

Penthee commented May 12, 2016

Okay so I've created a new project and have set up a super basic test of receiving different kinds of input from the controller.
The issue still remains so here is the test project I just made.
Let me know if you want to have a look at the full project.

As for the second issue, Script Execution Order fixed it - thanks, didn't think of that! :)

Appreciate the prompt reply!

@daemon3000
Copy link
Owner

Jump, Cancel, LeftBumper and RightBumper are buttons but you call InputManager.GetAxis which will always return zero. Use InputManager.GetButton instead.

@Penthee
Copy link
Author

Penthee commented May 12, 2016

I can't believe I didn't see that. How very... embarrassing. :')

Thanks for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants