Search Unity

Input system buttons get stuck while unfocussing game

Discussion in 'Input System' started by Dennis_0172, Jan 10, 2022.

  1. Dennis_0172

    Dennis_0172

    Joined:
    Nov 19, 2021
    Posts:
    4
    Hey,

    I'm using the input system and I'm encountering an issue on Unity 2020.3.14f1 with Input system version 13.0.
    Upon building and starting my game I press "W" to walk forward, after that, I will click outside of my game and re-click in my game view, after this, it still thinks my "W" is pressed and it is stuck.

    Code (CSharp):
    1.         public PlayerCharacterInput(PlayerActionMap actionMap)
    2.         {
    3.             playerActionMap = actionMap;
    4.             playerActionMap.CharacterController.Shoot.performed += ctx => shotPerformed = true;
    5.             playerActionMap.CharacterController.Shoot.canceled += ctx => shotPerformed = false;
    6.  
    7.             playerActionMap.CharacterController.Movement.started += ctx => movement = ctx.ReadValue<Vector2>();
    8.             playerActionMap.CharacterController.Movement.performed += ctx => movement = ctx.ReadValue<Vector2>();
    9.             playerActionMap.CharacterController.Movement.canceled += ctx => movement = ctx.ReadValue<Vector2>();
    10.         }
    Tried all the different button variants.


    1. https://www.toptal.com/developers/hastebin/ulihebiyal.csharp
    2. https://www.toptal.com/developers/hastebin/elunutipas.csharp
     
    Last edited: Jan 10, 2022
  2. Dennis_0172

    Dennis_0172

    Joined:
    Nov 19, 2021
    Posts:
    4
  3. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    saskenergy and a436t4ataf like this.
  4. Lesleyann

    Lesleyann

    Joined:
    Feb 11, 2019
    Posts:
    1
    @dmytro_at_unity, I don't suppose you've got even a rough ETA on the backporting do you?