Search Unity

Filter Noise On Current activated, but DualShock controller still become current, even without event

Discussion in 'Input System' started by MFleurus, Apr 29, 2020.

  1. MFleurus

    MFleurus

    Joined:
    Feb 4, 2019
    Posts:
    3
    Hello everyone!

    This is my first question, so please excuse me if I make some mistakes while writing this.

    I'm trying to adapt my UI depending on the current gamepad used by the player. Do to that, I've made a class that track changes on the latest controller used. You can see how I'm doing this in this screenshot of my code.


    I have a Xbox 360 controller and a DualShock 4 controller, both plugged with USB cable, and the Dualshock 4 controller is always the current one. When I do an action on the Xbox controller, it become the current gamepad only for one Update call, before returning to the DualShock controller.
    I made some reseach, and I've found that this is caused by the DualShock controller's gyroscope always sending new data, and that it can be resolved by activating the Noise Filter on Current gamepad in the project settings.
    I did that both in my project settings and in the "Start" call of the class described above. But it's still without effect, the DualShock controller still become the current gamepad every time.

    Did I miss something ? Maybe I should not use parameter "wasUpdatedThisFrame" ?

    Thank you for you time, I hope you'll be able to help me :).

    Edit: after looking a bit at the gamepad object that represents the Dualshock controller, it does not seems to be marked as noisy, hence why the noise filter does not work. It seems to be why I have trouble. How can it be marked noisy ? The parameter is not settable. :/
     

    Attached Files:

    Last edited: Apr 29, 2020
  2. alexanderperrin

    alexanderperrin

    Joined:
    Dec 15, 2016
    Posts:
    67
    Did you ever find a solution for this? I'm experiencing the very same issue, with the very same configuration!
     
    valentin56610 likes this.
  3. MFleurus

    MFleurus

    Joined:
    Feb 4, 2019
    Posts:
    3
    Unfortunately, no, I didn't find anything. To be frank, I have spent so much time on this that I haven't worked on this issue since I posted this question. If I find something, I will post an update.
    Sorry :(.
     
  4. cjonasw

    cjonasw

    Joined:
    Jan 16, 2017
    Posts:
    1
    Running into the same issue. Also I have an added complexity because I'm using a Xbox360 (with dongle) controller and PS4. The Xbox controller is part of
    Joystick.all
    and PS4 (Dualshock) is part of
    Gamepad.all
    .

    It seems like Filter Noise on Current just isn't making any difference.

    I've approached it exactly the same, I used both wasUpdatedThisFrame and a check on lastUpdateTime. Both not very helpful when the PS4 controller is behaving like that. haha

    I'll post if I get any closer.

    Edit: Yep, I also noticed the PS4 controller is not marked as noisy which makes this even harder.

    Update: @guavaman 's Rewired works perfectly... but it's 40 euros, I tried the trial and works great, not sure I'll buy it to solve this small and probably uncommon use case of 'using 2 devices and detecting the current device', but looks like it's got solid support for different devices and good documentation.

    Rewired: https://assetstore.unity.com/packages/tools/utilities/rewired-21676
    Trial: https://guavaman.com/projects/rewired/trial.html

    I wish Unity put more effort into this, it's a nightmare when you want to show device specific button symbols depending on the device the user is using. Again, not that this is a common use case to be switching back and forth between an Xbox 360 controller and a Dualshock controller but even the one is a nightmare. I noticed it recently working perfectly in a few Unity games on Steam while trying out some new gamepads I was buying, just to make sure it's something that is 'supposed to work'.
     
    Last edited: Jun 25, 2020
  5. Rspect

    Rspect

    Joined:
    Dec 27, 2020
    Posts:
    1
    Exactly what im running into right now, any solutions?
     
  6. arosolino

    arosolino

    Joined:
    Jan 14, 2017
    Posts:
    1
    I also wanted to report I am having the same issue as well with DualShock being triggered on Xbox 360 stick movements.
     
  7. meganinja

    meganinja

    Joined:
    Apr 2, 2015
    Posts:
    35
    I'm having the same problem. I believe it's noise from the DualShock 4 but I don't have any other controller to test it. I'm trying to auto-switch to Mouse and Keyboard when the player moves the mouse but it seems through the Input Debug that the PS4 controller is giving Input every frame.