-
Notifications
You must be signed in to change notification settings - Fork 328
Description
I have a personal project that I just migrated over to the new Input System and it all works great when playing locally in the editor (and also in Windows Release & Dev builds). However, when building the game for WebGL, it appears as though no input is detected at all.
I'm running on Windows 10 x64 and have this problem on Unity 2019.1.5f1 and 2019.1.6f1.
The problem is prevalent when running the WebGL build in Microsoft Edge, as well as when running it in Chrome on the local NodeJS server that Unity instantiates via the Build & Run
option.
Steps to reproduce
- Create a new, blank project.
- Add the Input System package to the project via the Package Manager.
- Enable the input backends in the project settings (set
Active Input System
toInput System (Preview)
). - Create a test
GameObject
and add aPlayerInput
component to it. - Click
Create Actions...
and create the default Input Actions. - Set the
Behaviour
toInvoke Unity Events
. - Map an action to a custom script method (I just tested it with
Move
, but it is also broken on my personal project for every action:Move
,Look
&Fire
. - Make the custom script method do something in-game in response to the
Input Action
callback (I made it move my testGameObject
'sRigidbody
) to assert that it's being invoked. - Run the project locally and confirm that it works in the editor.
- Build for WebGL and run.
- Input is not detected at all.
Expected and Actual Results
It is expected that input via the default PlayerInput
's InputAction
s is detected in WebGL builds.
This is not the case however.
Additional Information
I've just done a development Build and Run
with the profiler attached and then opened up the Input Debugger
. The option to Show remote devices
became enabled and, after clicking on it, I discovered that there was an Autoconnected Player
with devices labeled 'Keyboard1' and `Mouse1' shown. Upon inspecting their realtime event data (via the double-click dialog) I can say that there is definitely no input being detected.
I do not have another mouse and keyboard attached to my machine.
I took a quick look in the source files here on Github and saw an interesting Unit Test named 'Remote_ExistingDevicesAreSentToRemotes_WhenStartingToSend' here. From what I can tell judging by the name, it appears that the expected behaviour is that the existing devices are sent to the remote(s), but that certainly does not seem to be the case for me.
Here is an image of what I see in the Input Debugger
in hopes that it helps: