Input system stops working
Editor on macOS, Unity 2018.3.0b1
Sometimes, it happens randomly that the input system stops working. No events are ever fired again, unless the editor is restarted.
I know this is not much information to go from, but this happens a few times a day with a project using the input system
When it happens again, could you take a snapshot of what the Input Debugger looks like at that point? Are all the devices gone? Is it happening right after a script change / when going into play mode? Is the system spilling anything in the console or is it just sitting there and simply does nothing?
events are ever fired again
Events as in no input events are actually coming in or as in none of the action callbacks are being triggered?
Upgraded project to Unity 2018.3.0b2
Okay, so the device count is 0, and when I enable diagnostics, the console spams:
Cannot find device for input event: id=73541 type=STAT device=7 size=52 time=21.024752084224
UnityEngine.Experimental.Input.LowLevel.<>c__DisplayClass6_0:<set_onUpdate>b__0(NativeInputUpdateType, Int32, IntPtr)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/Input/Private/Input.cs:91)
Cannot find device for input event: id=87298 type=STAT device=2 size=1016 time=191.117491006851
UnityEngine.Experimental.Input.LowLevel.<>c__DisplayClass6_0:<set_onUpdate>b__0(NativeInputUpdateType, Int32, IntPtr)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/Input/Private/Input.cs:91)
Note that the device, size and time changes in the console, not all the exceptions are identical
Looks like the input system is losing all its devices. Is this happening right after changing scripts or going into play mode?
I notice the change when I go into play mode (so not in the middle of play mode) So it could be caused by script recompilation or domain unload. Either way, it's not always consistent (doesn't happen every time)
Sounds like we definitely have a pretty serious bug in the refactored domain reload code then.
I will try to provide a repro repository as soon as I can
Here's a repo where I used the input system https://github.com/iBicha/sevakon
There's also a weird bug that happens only when the Input system fails, which makes a Job run in unexpected behaviour. I suspect that the input system and job system might be interfering with each other. I'll investigate further, and open a separate issue when I have more details
Hey @iBicha, thanks for keeping at it.
I've tried your project and various other things to try to reproduce but so far unfortunately without luck. However, I received a report from another user so you're definitely not the only one seeing this problem.
I'll keep digging.
Ok, finally seeing this, too. For me, seems to only happen when using the .NET 4 runtime. Haven't seen it when using the .NET 3.5 runtime.
Yes during testing the project was a .NET 4
This should be fixed @iBicha Do you still have this issue with 0.2.6-preview?
@JiaUnity I have the same issue on my mac using 0.2.10 and Unity 2019.1.3f0.