Search Unity

GetButtonDown and GetKeyDown true every frame on Xbox One

Discussion in 'Windows' started by bphillips09, Sep 7, 2018.

  1. bphillips09

    bphillips09

    Joined:
    Aug 31, 2014
    Posts:
    36
    Hi!

    So, I've noticed what I think is a bug. It started occurring in 2018.2.2 and is still happening in 2018.2.6f1.

    Here is a video of the issue:


    In essence, anything using GetButtonDown("Button Name") or GetKeyDown("joystick button XXX") will return true every frame (as if it were just GetButton or GetKey). It works as desired in the editor, standalone builds, and even UWP builds for PC. However, once the UWP build is run on Xbox One, it will start misbehaving. I have only tested on IL2CPP builds.

    This also happens with UI elements when they are selected and the submit button is pressed.

    This is using Unity's default Input Manager

    Am I missing something obvious? Or is this a bug?

    I have tested in a new Unity project with a few lines of code and can confirm the issue still exists (UWP build works fine on Windows, but broken on Xbox One)

    Builds from 2018.2.2 and 2018.2.6 behave the exact same on Xbox One.

    I've submitted a bug report and am waiting for a confirmation. If you want to reproduce it:
    1. Start a new project and make a UI Button.
    2. Set the button as the First Selected GameObject and set the Standalone Input Module to Force Module Active
    3. Make some simple code for the Button's onClick that increments a number when the button is pressed (and output it to the screen)
    4. Build for UWP and test on Windows and see that it behaves normally, then test on Xbox One and see that the button is pressed once per frame.

    For reference, I have submitted the test project as a Bug Report with Case ID 1078722

    Alternatively, map a joystick button as a Button and use GetButtonDown to verify that the issue exists there, too.
     
    Last edited: Sep 7, 2018
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Did this start happening after you upgraded to 2018.2? Or you haven't tried older Unity versions?

    In either case, thanks for the bug report. We will take a look.
     
  3. bphillips09

    bphillips09

    Joined:
    Aug 31, 2014
    Posts:
    36
    I haven't tested it fully on Unity 2017 yet. I don't have a version installed on this PC anymore but I might on another PC.

    If the issue exists on Unity 2017, should I make another bug report?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    No, that would just have been helpful information.
     
  5. bphillips09

    bphillips09

    Joined:
    Aug 31, 2014
    Posts:
    36
    A friend with 2017.3 told me it works as desired.

    Have you been able to confirm that this is a bug and not something I'm doing wrong?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Unfortunately without a repro project that wouldn't be very useful. However, if you report a bug report, our QA will definitely take a look.