I’ve encountered an issue with new input system just today. Input is triggered even if i press button while game view is not in focus. For example, i click on console message and my player shoots, or i press W to select move tool in scene view and my player going forward
Tried both performed and started events
This occurs only in editor, in build everything is fine
OS: Ubuntu
Editor: 2019.3.0b9
Input System: preview.1 - 1.0.0 from october 11, 2019
I think it’s like that by default and it’s normal. If you don’t want this behaviour, go into the input debugger, there is an Options dropdown and you can lock inputs to the game view
Begin from Input System 1.1.1 (September 2021)
The option was replaced by two separate options in Project Settings/ Input System Package (if you want old “Lock input to game view”), you must set:
Background Behavior - Ignore Focus (additional you must set Project Settings/ Player (Resolution and Presentation) Run In Background = true
(Edit) Play mode Input Behavior - All Device Input Goes to Game View
As of 1.1, default behavior when in play mode should be that all input goes to the game view when focused whereas all input except for pointers and keyboards does so when not focused (put another, mouse/pen/touch/keyboard should respect focus, everything else shouldn’t). Deviation from that behavior I’d consider a likely bug.
Intention is that stuff like gamepads and XR are not constrained by game view focus whereas input that is used to interact with the editor itself is respecting focus.
Anyways I was working on an integration update for my asset for new input system. Also I don’t want to update it since some users won’t. So I ended up with my own implementation to prevent this from happening.
Yes, You use the previous version which came by standard with 2021. But I install the 2020 and after I update the Input System (through the Package Manager) to Input System 1.1.1 (September 2021!!!) to receive possibility to test the latest binding for “Vector3 values”.
But As I read begin from 2021 “Unity Co” closed the possibility to install not fully verified version of package, as the Version 1.1.1 for Input System. And you doesn’t see it in list of all available version, They close the option to “see all version” (I think it’s a “stupid solution” with motivation to make the life of Unity programmers are more safe)