Search Unity

A couple of issues trying out the new InputSystem on 2018.3.3f1

Discussion in 'Input System' started by Luminoth, Jan 26, 2019.

  1. Luminoth

    Luminoth

    Joined:
    Jan 15, 2013
    Posts:
    25
    I'm noticing a couple of issues using the new InputSystem during the global game jam and was wondering if they were known or not.

    1) I have an action bound to leftStick [Gamepad] with no Interactions and no Processors as well as an action bound to buttonSouth [Gamepad] with an interaction of PressAndRelease and no Processors. In my game, using the Interface callbacks, if I hold the stick in a direction and then hold the button, I lose input from the stick. I'm not getting the callback for it at all until I move it in a different direction.

    2) I have a UIActionInputModule in my scene with the Cancel Action bound to an action in my inputasset that has a binding of Cancel [Any] (PressAndRelease) and buttonEast [Gamepad] (PressAndRelease). I then connect that action in my script like this:

    Code (CSharp):
    1.  
    2.         private void OnEnable()
    3.         {
    4.             // this only works the first time? why?
    5.             InputManager.Instance.EventSystem.UIModule.cancel.action.performed += OnCancel;
    6.         }
    7.  
    8.         private void OnDisable()
    9.         {
    10.             if(InputManager.HasInstance) {
    11.                 InputManager.Instance.EventSystem.UIModule.cancel.action.performed -= OnCancel;
    12.             }
    13.         }
    14.  
    15.         public void OnCancel(InputAction.CallbackContext context)
    16.         {
    17.             // this disables this object, calling OnDisable()
    18.             EngineManager.Instance.TogglePause();
    19.         }
    20.  
    The first time the object enables / disables it works fine, but when I enable it the second time, the cancel action no longer fires. It seems like I'm setting it up correctly... but, I guess not?
     
  2. Luminoth

    Luminoth

    Joined:
    Jan 15, 2013
    Posts:
    25
    On that second issue, it seems like disabling my player controls and enabling the menu controls is the problem. I haven't been able to figure out why tho. If I have 2 controllers plugged in, each with their own private instance of the asset, the controller that calls Disable() first can't do any UI actions while the second controller can. It's really confusing.
     
  3. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Sounds buggy. Filed a ticket here. We'll take a look.

    UIActionInputModule desperately needs a pass. Been hoping we'd get to it by this point but unfortunately we haven't. Especially multiplayer UI is untested territory ATM.

    Enabling/disabling problems may stem from UIActionInputModule's own handling. When the module was written, there were still a number of questions around who owns action enabling/disabling and where and when exactly it happens. It has crystallized since but the UI module still needs to catch up.

    Current plan is to give UIActionInputModule a proper once over for 0.1.15-preview (we're currently working on 0.1.13-preview).
     
  4. Luminoth

    Luminoth

    Joined:
    Jan 15, 2013
    Posts:
    25
    Alrighty, I was thinking that might be it, but wasn't super sure if I was doing things correctly on my end or not. I'd been running into problems with multiplayer inputs in general because I wasn't calling MakePrivateCopyOfActions() for each player's instance and was hoping there might be some similar piece of the UIActionInputModule that I maybe wasn't setting up properly.

    Thanks for getting back to me! I'm looking forward to the next update, the new system (last time I used it was back in August of last year I think) is so much easier to use than the old one!
     
  5. Luminoth

    Luminoth

    Joined:
    Jan 15, 2013
    Posts:
    25
    Oh, also, that issue with the UIActionInputModule seems to be unrelated to multiple controllers being plugged in. It's happening even when I just have keyboard / mouse / single gamepad plugged in.
     
  6. Juixa

    Juixa

    Unity Technologies

    Joined:
    Sep 6, 2017
    Posts:
    7
    Does this still repro on 0.2.0-preview?