Building to WebGL changes my inputs.

I’m using Unity 5.4.4p4. I have a project that reads inputs from a PS4 controller which I mapped out under the Project Settings. It works fine during runtime, and it runs fine if I build it to a Unity file. When I build it to WebGL, it completely remaps the inputs. I was able to remap most of the inputs to account for the issue, but I’m unable to determine how to map L2,R2, the left and right buttons on the D-Pad, and the touchpad. It’s worth noting that, having done this, the game is now completely unplayble in the inspector but will (mostly) work in for the WebGL build.

I tested the PS4 controller using this website, and it seems mostly correct, but it still doesn’t want to pick up the buttons I mentioned within the Unity build/

Anyone else struggled with something similar and found a solution?

I managed to find a script online to show me which inputs are being processed while the game is running:

https://stackoverflow.com/questions/52377844/joystick-controller-works-on-editor-but-not-on-builded-game

It goes without saying that the inputs are being completely reconfigured during the build process, but in the WebGL player the touch pad and L2/R2 don’t register at all despite working perfectly while running the scene or building for Windows.

Tried in both Firefox and Chrome. Same issues.

WebGL support for controllers is very browser dependent, differing even between browser versions, and known to be spotty at best.

Here’s what Rewired’s documentation says about the problem
https://guavaman.com/projects/rewired/docs/FAQ.html#webgl-support

2 Likes

That’s a shame. Thank you for the help.