GameCube controllers support

So I had access to game cube controllers a few months ago, and figured I’d implement HID classes for those godly controllers, here it is: github repo

Installation is pretty straight forward, add it as a git package from UPM, and yeah. It gets registered as a GameCubeController type, which inherits from Gamepad. It will also reimplement some of the properties from the Gamepad class and return null on those on purpose (since those controls dont exist, or no close relative is available).

The controls are documented in the readme file, enjoy.

2 Likes

Hey @print_helloworld , I’m trying to make this work but nothing is reacting when I press my controllers. I have the official adapter, and it’s working on Dolphin with the Zadig installer.

I don’t think I’m using it the correct way, I’m trying the input action window to map the controls…

Is it normal if my gc controllers does not appear in the Input Debug?

Maybe you can help? Have a nice day.

If the device does not appear in the Input Debug window then no, its not normal. In my case, with the zadig drivers the adapter should at least show up as an unrecognized device, can you show me the list? The adapter that I used specifically is the mayflash 4 controller one.

Okay, it may be because I’m using the official adapter
6528953--737321--upload_2020-11-16_18-19-49.png

Hmm I see, it might be mapped as the XInput controller there (unless you have a generic controller or steering wheel plugged in). If thats the case do you mind sharing the name, layout, type, interface, flags and keyboard layout? I might be able to find a way to override it so that the controller gets mapped as a GameCube Controller type instead of an XInput one.

Nah, the XInput you see is a XBox Series controller plugged in to my computer…

The adapter may be the 4 “Logitech USB Keyboard (HID)”?

Okay, I reinstalled everything, and I’m still stuck. Gamecube Controller is not showing up in Unity, and I’m trying to understand your code: there’s a vendorId, maybe it’s not the same since I’m not using the same adapter?

I have come to the conclusion that the official adapter needs a special wrapper. I don’t know how to do that, but it looks like a fun challenge. I need to find how to access the WUP-028 device from the new Input System. If you have any information, I take it :slight_smile:

Thanks a lot for your reply.

Well, if the device doesnt even show up on the list, you wouldnt be able to check against the vendor ID in the first place, the mayflash and the zadig drivers work because zadig overwrites the existing drivers with their own to where windows attempted to install.

Ooh, I’m loving the idea of this!!

I would like to implement this as I am making a Super Smash Bros. fan game in Unity and have always wanted to support these controllers!

I can’t wait to try. :slight_smile:

1 Like

I’ve been trying to get this to work but there seems to be an issue with recognizing the GameCube Controller for me. I get this error. I tried to change some things in GameCubeController.cs but it didn’t seem to solve anything as far as I know so I’m not sure what to do now, if you have any idea what might be going wrong I would love to hear from you.

Here is the link to the full error (They are all the same, I assume because of the nature of the Mayflash adapter simulating 4 controllers at once) Layout 'GameCubeController' matches existing device 'mayflash limited MAYFLASH G - Pastebin.com

EDIT: My adapter didn’t show up in the Input Debug Window at first but for unexplained reasons it did after restarting it a couple of times as an unrecognized device.

EDIT 2: It can’t find the mayflash adapter anymore, it might have found it when I turned PC mode on? In any case I have no issue when trying to use my gamecube controller with other programs/games like Dolphin or Nickelodeon All-Star Brawl. So I’m not sure what the issue is.

Here is the device description of the mayflash device listed in the image above:

“interface”: “HID”,
“type”: “”,
“product”: “MAYFLASH GameCube Controller Adapter”,
“serial”: “”,
“version”: “256”,
“manufacturer”: “mayflash limited”,
“capabilities”: “{"vendorId":121,"productId":6211,"usage":4,"usagePage":1,"inputReportSize":10,"outputReportSize":3,"featureReportSize":0}”

It should be able to create the individual controls juts fine (as it worked back then), from the error logs in the first screenshot it looks like the type of control should change to become an AxisControl. Im actually not sure why the controls are “supposed” to be a ButtonControl because back then this was never an error. I also dont have these controllers and the adapter anymore, so sadly I cant test and fix it atm.

@T00nbink

I bought a controller and the adapter, and I’ll be getting them on the 10th (no amazon prime on the mayflash rip). So I’ll be able to take a look at the current issues. I also have an issue on Github about this too.

I’ll see what I can do when I get the hardware in.

I’m still unsure if this is something I did wrong but if you could take a look at it that would be great. Thank you for replying and going to so much trouble to help me.

I dont know how this issue occurs, the version that I tested the GC controller on didnt have this issue (1.0.0), and I dont have the controller nor the adapter atm so I cant test and fix this issue. I linked the github issue because it mentions that im getting one and the adapter to verify it and fix any extra bugs. What version of the input system is this btw?

Version 1.0.2, the latest one I assume.

Hello

Hello, I’m having trouble trying to config my GameCube controller for the new input system. But it looks like whenever I connect the adapter, it shows an error in the image below. I’m using a pdobq adapter and I don’t know if it has something to do with my adapter or how I installed it, since I installed the package from disk. It seems my computer is picking it up as a GameCube controller adapter, but not the unity version.

7818978--989304--Screenshot (197).png