New input system does not work in WebGL 2021.2.0b1

repro:

  1. I’ve installed Input system Version 1.1.0-pre.5 - May 14, 2021
  2. Imported touch examples
  3. Built it for webgl

The ui menu in this build build does not react on input. Mouse and keyboard do not work. Tested on Safary and Chrome

Found some details. the scene with menu does not crash, but menu does not work.

The scene with drawing example crashes

The crash was cause of

        [RuntimeInitializeOnLoadMethod]
        private static void Register()
        {
            InputSystem.RegisterBindingComposite<PointerInputComposite>();
        }

Changed to

        [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
        private static void Register()
        {
            InputSystem.RegisterBindingComposite<PointerInputComposite>();
        }

This fixed the crash, but input does not work at all

I reported bug. Maybe I can tag somebody from Unity?

1 Like

Important notice:
It works in 2021.1 and does not in 2021.2.0b2

Have the same issue,

Reported it case 1348343.

@LeonhardP , can you confirm if this issue has been raised properly? Makes it impossible to deploy WebGL with the new input system.

1 Like

Thanks for the bug reports. We have received them and will investigate.

2 Likes

I missed to tell, my case is (Case 1347300) for the input and (Case 1347311) for the exception in Touch examples. Thank you @LeonhardP , lets make unity strong :slight_smile:

1 Like

dismalsecondasianporcupine

2 Likes

In the latest Unity 2021.2.0b4, Project without ‘Input system Version 1.1.0-pre.5 - May 14, 2021’, the input also wont work when building for WebGL

Things in scene:

  1. simple button that call Debug.Log()

Expected:
Browser console show console.log, but it didn’t.

1 Like

Both of the previously mentioned issues in this thread have been reproduced on our side:

The devs are looking into it.

4 Likes

Is it because “Event code could be stripped from build when using il2cpp”?

Do you have information on which beta version (Unity Issue Tracker - [WebGL] Touch events do not work when in built Player) is expected to land @LeonhardP ?

I can’t say for sure. At the earliest b7 but it hasn’t landed yet.

@LeonhardP ,

Related to this, as per the comments above; issue 1347311 is still ongoing in b7.

Do you have some insight on when it might land?

The fix for this issue is in landing pattern for our main development branch right now (22.1). Once it has landed, it can get backported to 2021.2. I wouldn’t expect it to land before b10.

2 Likes

Thanks for keeping in touch!

1 Like

Unfortunately the fix won’t be in b10. I’ll update the thread once I know when it landed.

1 Like

Using b15 and there are no errors and yet the mouse is not working while the keyboard does.

Having this same issue, keyboard works but mouse doesn’t. Using Unity 2021.2.15f1