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

Spotty performance at times. #42

Open
TabuuForteAkugun opened this issue Dec 25, 2020 · 6 comments
Open

Spotty performance at times. #42

TabuuForteAkugun opened this issue Dec 25, 2020 · 6 comments

Comments

@TabuuForteAkugun
Copy link

Hi dude! LOVE this plugin. Using it to add controller support and local multiplayer to my Unity game 😁 This stuff was a godsend to me and was so easy to set up!

But I have some issues with it, regrettably, lately. Sometimes I get spotty performance. Meaning sometimes the gamepad just won't connect. It's especially finicky when I plug and unplug my controller.

Right now I'm using Unity 2020.2.1f1 as of this comment. And the inputs aren't responding. I've made sure to include GamePad's Update() and Refresh() methods in the correct places, but Unity won't detect that my controller's plugged in. Sure, when I unplug and replug, I get a Console message that says "Gamepad F-310 connected", but I mash the button and my character just won't budge.

Am I doing something wrong? :(

Thanks for reading, and I love your work!!

@speps
Copy link
Owner

speps commented Dec 27, 2020

I would need to take a look at the code to be able to help you but it's weird that you mention a Refresh method, there isn't one.

@TabuuForteAkugun
Copy link
Author

Idiot idiot idiot lol (not you, me lol)

I have a special class that has it that has a sort of interface to the plugin. THAT has the Refresh method, sorry hahaha. I'll see if I can attach the code.

New Text Document.txt

Like. I just tried it again. The button works that turns on the Windows gaming menu stuff, so the pad is plugged in and recognized, but in the game, A, B, X, Y, etc don't respond. I have code that disables an InputController class when the pad is not connected. But it constantly unticks it, making it register as unplugged.

@speps
Copy link
Owner

speps commented Jan 7, 2021

From this file, make you call Refresh just before Update. A look at the code that calls the gamepad code would be helpful too.

@TabuuForteAkugun
Copy link
Author

In Unity I have Update() on MonoBehaviour.Update(), and Refresh() in LateUpdate().

@speps
Copy link
Owner

speps commented Jan 7, 2021

Try with Refresh() just before Update() inside MonoBehaviour.Update() like:

Refresh();
Update();

@TabuuForteAkugun
Copy link
Author

You think that might solve my detection problems I sometimes get? I'll try.

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