Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Bug MultiTap not working with Keyboard/Mouse + Gamepad active simultaneously

Discussion in 'Input System' started by Lucideus, May 21, 2020.

  1. Lucideus

    Lucideus

    Joined:
    Dec 7, 2015
    Posts:
    2
    I do suspect this is a bug but I might just be doing something wrong here, if so, help would be appreciated!
    I'm currently attempting to do a Barrel Roll by either double tapping Shift or double tapping the Right Trigger on a gamepad.

    I do so by adding a BarrelRoll action and adding a MultiTap interaction to it, with the ActionType left as a Button.
    Adding only one Binding, say Left Shift and assigning it to Mouse/Keyboard(Control scheme), it works just fine. It responds to the double tap as expected.
    However, if I add another binding it just refuses to work if my gamepad is plugged in. It doesn't matter if its assigned to my Gamepad control scheme or not - as long as it's plugged in and if there are more than one binding, it will not trigger. Only if I remove one of the bindings or unplug the gamepad will it work.

    Any help would be appreciated to understand what's goin on here! inputSettings1.png

    inputKB.png

    InputGP.png
    I would suspect it was my code but as a I said - it works perfectly fine as long as there's only *one* binding present or if the gamepad isn't plugged in, but in case it's to any use here's the simple code:
    Code (CSharp):
    1. public sealed class BarrelRoll : MonoBehaviour
    2. {
    3.  
    4.         [SerializeField] private float _BarrelRollDuration;
    5.         [SerializeField] private Transform _Model;
    6.         [SerializeField] private PlayerController _PlayerController;
    7.  
    8.         private Controls _Controls;
    9.  
    10.         private void Awake() => _Controls = new Controls();
    11.         private void OnEnable() => _Controls.Player.BarrelRoll.Enable();
    12.         private void OnDisable() => _Controls.Player.BarrelRoll.Disable();
    13.  
    14.         private void Update()
    15.         {
    16.             var input = _Controls.Player.BarrelRoll.triggered;
    17.  
    18.             if (input && !_InBarrelRoll)
    19.             {
    20.                 HandleBarrelRoll();
    21.             }
    22.         }
    23.  
    24.         private void HandleBarrelRoll()
    25.         {
    26.             if (!_Model)
    27.                 return;
    28.  
    29.             var direction = _PlayerController.XDirection;
    30.  
    31.             _Model.DOLocalRotate(new Vector3(_Model.localEulerAngles.x, _Model.localEulerAngles.y, 360 * -direction),  _BarrelRollDuration, RotateMode.LocalAxisAdd).SetEase(Ease.OutSine);
    32.         }
    33. }
    Excuse the strange formatting.

    Edit: Just as an update, if I set the Tap Count to 1 then it does trigger the barrel roll but obviously not the way I want it to because I want it as a multitap, not a single tap.
     
    Last edited: May 22, 2020
    velenrendlich likes this.
  2. Eugenio

    Eugenio

    Joined:
    Mar 21, 2013
    Posts:
    177
    I second this post: the MultiTap doesn't work !!
    Setting a TapCount > 1, the performed action will not be triggered therefore there is no way to register the wanted action.
    lf TapCount == 1 then all works properly but, of course, it's not what I want from a multitap behaviour :p

    Is there anyone from Unity that can help with this, please?

    Thank you very much :)
     
  3. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    201
    I'm also having some issues with double taps. My setup is as such

    upload_2020-6-14_12-13-2.png

    Tested some of the things you guys said and can confirm that it seems to be an issue.

    Controller unplugged = keyboard double tap works as expected
    controller plugged in = no double taps work. not on keyboard or controller.
    setting tap amount to 1 = works for both keyboard and controller but again this isn't what we want.

    would be nice to get a response from someone at Unity about this :)
     
  4. velenrendlich

    velenrendlich

    Joined:
    Jan 22, 2018
    Posts:
    72
    Same issue. Multi tap does not work at all.
     
  5. Eugenio

    Eugenio

    Joined:
    Mar 21, 2013
    Posts:
    177
    Update on this: I'm not sure if a bug report was submitted about this issue, so, I made one.

    You can check its status here:
    http://fogbugz.unity3d.com/default.asp?1267805_9jndm3div6phpa8h

    Cheers !! :)

    UPDATE:
    I attached to this message the Unity project submitted to test the bug.
    To test it yourself:
    - double tap the Gamepad south button
    - double click the Mouse left button
    - double click the Keyboard space key
    - double tap on the Touchscreen of your mobile device (only on Android or iOS builds)
    Depending on the selected mode, the double tap will work or not.
     

    Attached Files:

    Last edited: Aug 3, 2020 at 11:12 AM
unityunity