Hey everyone.
I’m posting here because I’m running out of ideas.
I’m working on a local coop game (PC), up to 3 players, and I support different type of gamepads (xbox variants, ps4, ps5, switch).
Everything was working fine for years.
I could use whatever type of pad, detecting the type properly, etc.
But for convenience in the last couple of months (because I’m also using my PS4 pads with my PS4), I was mostly testing with xbox pads only.
Recently, I retried with a PS4 pad, and here is the issue: the PS4 pad is well detected in Unity, but is also detected as an xbox controller.
Basically if I have a xbox pad connected and a PS4 pad connected, Gamepad.all is giving me 3 gamepads, instead of 2.
The thing is that I don’t have ds4windows or ds4tools installed (which I know could cause this problem).
My PS4 pad is connected via USB (not bluetooth, and I don’t have the adapter anyway).
Windows is not detecting any virtual pad (I have 2 pads only in the device list).
And an old version of my project running on 2020.2.3f1 doesn’t have this issue.
Gamepad.all is giving me the correct amount of pads.
I know it was working on 2022.x.x at some point, but can’t figure out which version, since I retried with my PS4 pad just recently.
The only thing I know is that it was at least happening on 2022.2.5f1, and updating to latest (2022.2.19f1) doesn’t fix any issue.
If anyone have any idea, I would gladly appreciate the support.
Thank you so much in advance, and have a wonderful day.
It definitely has global effects. Try excluding the controller type in the big picture settings. Im not 100% sure this is your problem but its worth checking.
Yes, as mentioned above i Do have the same Problem, but with a switch pro Controller. I also have an older Projekt where everything was working fine.
I would also appreciate a solution…
I’ve tested by creating a project from scratch, just using Input System and displaying gamepad.all via debug.log.
It’s also happening, so it confirmed that it’s coming from a change in the editor / package at least.
It’s asking not to share the link publicly in the reporting portal for now.
But I can give you an update once I have one or if they create a Jira ticket, I’ll share the link for sure!
Thanks for keeping us updated. As already mentioned in this thread, some of us have this (or similar) problem with Switch Pro controller. As an ugly workaround I used this “method of detecting” this and disabling duplicate:
// We execute this code on `playerInput.onControlsChanged`
if (gamepad is UnityEngine.InputSystem.Switch.SwitchProControllerHID) {
foreach (var item in Gamepad.all) {
if ((item is UnityEngine.InputSystem.XInput.XInputController) && (Math.Abs(item.lastUpdateTime - gamepad.lastUpdateTime) < 0.1)) {
Debug.Log($"Switch Pro controller detected and a copy of XInput was active at almost the same time. Disabling XInput device. `{gamepad}`; `{item}`");
InputSystem.DisableDevice(item);
}
}
}
I shared this on the other thread some days ago, but realised it might be useful for other people here as well.
Thanks for the info.
I tried something similar myself, but sometimes, I got the “xinput version” of my PS4 pad being detected just before the real PS4 pad.
Kind of random.
So I couldn’t rely on update time unfortunately.
Hm, I think this is the case for our case as well – xinput is “detected” first, BUT, at least in our case, the inputs switch from one to another and back all the time, so at some point (usually very soon) this code “catches” them as the same.
Hi, Thanks for getting in touch, we actually know about this issue internally, but sadly since the issue is internal and not public, we cannot provide you with the issue tracker link. Please reach out to me if I can answer any questions or be of further help.
They closed my ticket as duplicate.
So I guess we wait.
Thanks for the Update. Its a shame that we dont have any hint as to when a fix might be provided. I guess we have to keep the input-System in Our projects uptodate until suddenly the Bug is fixed
Heaving the same issue since upgrading from 2021 LTS to 2022 LTS.
Very frustrating. It took me 3 hours to find out that the issue is not on my side. There are 2 issues though:
A/B X/Y swap
having two instances of controllers from one physical device - each triggering input
Just “watched” this thread to get latest infos. Please keep us updated if anyone knows more. I´ll wait until than with you guys and probably will use “zledas” solution.