InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

[Regression] The "Press" modifier on a component public InputAction binding no longer works

Open jackpr-unity opened this issue 8 years ago • 2 comments

Previously, press worked similar to "Input.OnButtonDown." Now it doesn't seem to function at all.

Reproduction steps:

  1. Create a script with a public InputAction. Enable the action in the Start function. Add a function the the performed event of the action that will print a debug line or something that shows the event fired.
  2. Add a single binding such as "Press Mouse leftButton" "Press Keyboard a" or "Press PrimaryAction"
  3. Press play, click on the game window, and actuate the appropriate binding

Here is the scene and script from my minimal reproduction. ActionPress (2).zip

Expected Result: When the bound input is executed, you should get an indication that it happened

Observed Result: No reaction.

Tested with 2018.2.0b1 and commit e216c7333858a2682b37964721f54201580565f9

jackpr-unity avatar Apr 23 '18 22:04 jackpr-unity

Found that InputDevice.wasUpdatedThisFrame is broken in the editor when the device gets updated in editor updates. This in turns breaks ButtonControl.wasJustPressed.

Rene-Damm avatar Apr 24 '18 00:04 Rene-Damm

Looks fixed with commit repo commit a357d9d004297ddc591eb45568efe9c21fff97da and unity editor commit 725fd26e2382.

Let's leave this issue here until the fix code makes it into a public editor release.

jackpr-unity avatar Apr 25 '18 16:04 jackpr-unity