Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Why new input system works without focus on game view in editor?

Discussion in 'Input System' started by IC_, Nov 6, 2019.

  1. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    61
    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
     
  2. Jichaels

    Jichaels

    Joined:
    Dec 27, 2018
    Posts:
    237
    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
     
    DSivtsov likes this.
  3. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    61
    Thanks for the reply, but I cannot change this value
     
  4. Jichaels

    Jichaels

    Joined:
    Dec 27, 2018
    Posts:
    237
    Weird, I can simply click on it and it toggles
     
  5. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    61
    I found Options -> Lock input to game view. But it doesn't change anything
     
    Last edited: Nov 7, 2019
  6. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    61
    bump
     
  7. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    File a bug report.
     
  8. DSivtsov

    DSivtsov

    Joined:
    Feb 20, 2019
    Posts:
    151
    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
     
  9. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    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.
     
  10. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    395
    Why can't you make it a simple option since you're changing the default behavior? I literally spent one hour to search but still can't turn it off.

    Lock input to game view doesn't work.

    And can't find this setting.
    • (Edit) Play mode Input Behavior - All Device Input Goes to Game View


    I don't know how many people benefits from this but it makes impossible to navigate in the Sceneview on runtime without disturbing gameplay.
     
  11. DSivtsov

    DSivtsov

    Joined:
    Feb 20, 2019
    Posts:
    151
    @razzraziel Very Strange See on picture. Did you use the Release 1.1 and upper ?
    P.s. the new interface more complex, but give more flexibility
    CaptureEditPlaymodeInputBehavior.JPG
     
    emredesu likes this.
  12. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    395
    No I don't have it, I thought I was using the latest version because no newer version shows up. I was using the version that comes with 2021.11f.



    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.

     
  13. DSivtsov

    DSivtsov

    Joined:
    Feb 20, 2019
    Posts:
    151
    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)
     
    Last edited: Oct 2, 2021