In my project, I have a script that stores a InputActionReference. In Update(), my script calls .action.readValue(), and stores that value, which it later uses to move the camera around.
This works perfectly fine until I unfocus the game view in the editor. Once I do that, Input.ReadValue() will always return (0,0,0), no matter what I do.
In the input debugger window, the keyboard still registers key presses, and the flags are reset upon regaining focus, so I am not exactly sure where to look from here.
Any ideas on what to check next would be greatly appricated!
Hi @Duck_With_Grape,
It sounds like you are “polling” the current state of the associated action binding every frame in Update(). This means that the current value of the device is what you get, even if the device state would reset based on focus mode. Based on the description I am not sure what underlying device is resetting to (0,0,0) here? Regardless I would suggest looking into Input System manual on the subject “background behavior” which might be what you are looking for?
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.11/manual/Settings.html#background-behavior