GetButtonDown and GetKeyDown true every frame on Xbox One

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.

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.

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?

No, that would just have been helpful information.

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?

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.