Crash in WEBGL games builds using new input system

Announcements, support questions, and discussion for the Dialogue System.
Swing Wren
Posts: 31
Joined: Fri Apr 10, 2020 2:30 am

Re: Crash in WEBGL games builds using new input system

Post by Swing Wren »

Before submitting a bug to Unity I need to collect some information about how the Dialog system is using the New Input system as I'm using the new input system also but I don't have this problem. Is all the new input system used in the InputDeviceManager.cs?

I don't think is language or system related as after testing in another two different computers and changing the system language the problem is the same but here you go:

Computer 1:
Windows 10 10.0.18363 Build 18363 - English (United States)
- Custom built -
Chrome (Version 81.0.4044.138)
Opera (Version 68.0.3618.125)
Firefox (Version 76.0.1)

Computer 2:
MacOs Catalina 10.15.2- English (United States)
MacBook Pro (2015)
Chrome (Version 80.0.3987.149)
Safari (Version 13.0.4)
Firefox (Version 76.0.1)

Computer 3:
Windows 10 Spanish - Spanish (Spain)
- Custom built -
Chrome (Version 83.0.4103.61)

Could you try opening the console while testing? I think you are having the error also just you don't have the browser console open to see it.

If I have some extra time I'll debug the dialog system to find a fix and post it here.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Crash in WEBGL games builds using new input system

Post by Tony Li »

I glanced too quickly at the browser's developer console and missed it, since I assumed it broke operation. That's correct that only InputDeviceManager.cs interfaces directly with the new Input System. It acts as a wrapper to isolate the rest of the Dialogue System from whatever input system is being used.

It may be related to the Unity forum link I posted above. In WebGL, the new Input System's Mouse, Keyboard, Gamepad, etc., are not initialized in Start and may not be initialized the first time Update is called either. I'm putting together a test of doing a null check on the Input System. I'll let you know the result shortly.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Crash in WEBGL games builds using new input system

Post by Tony Li »

It just needed a simple null check. That forum post from the Unity employee was correct. Unlike other platforms, in WebGL Mouse.current, etc., aren't initialized right away. Here's a patch:

https://www.pixelcrushers.com/dialogue_ ... itypackage
Swing Wren
Posts: 31
Joined: Fri Apr 10, 2020 2:30 am

Re: Crash in WEBGL games builds using new input system

Post by Swing Wren »

Thanks it worked perfectly!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Crash in WEBGL games builds using new input system

Post by Tony Li »

Great! This check is in version 2.2.7 also, which should be available on the Asset Store any day now.
Post Reply