InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

[0.2.6-Preview]Hold Interactions not working as expected?

Open Methedox opened this issue 7 years ago • 2 comments

Currently, I have an Action of type Button, with a Binding on the 'r' key. The binding have an interaction "Hold" with a Hold time of 2.

I added a debug log on each callback (started, performed, canceled) as their respective names. When I press 'r', I receive both callback started and performed regardless of how many time is set in Hold time.

I found this post from Rene-Damm in January stating:

"Put simply, you should see "started" getting called as soon as a button goes down, "performed" being called when the button is held for longer than the set duration, and "cancelled" being called if it's released before."

https://forum.unity.com/threads/new-input-system-how-to-use-the-hold-interaction.605587/#post-4056961

I have been messing with this for a while now, and the closest I could achieve is with the slow tap, only, the action performed were not called once the duration time was up and required a key release to be triggered.

Edit: Forgot to mention I was using 2019.1.0f2

Edit2: Still present in preview 0.2.8 using Unity 2019.1.0f2

Methedox avatar Apr 19 '19 03:04 Methedox

This may be related to issue #576. I've noticed that a context's duration continues to accumulate in the editor, even after exiting play mode. I suspect that the "hold" interaction watches this value to determine when time has elapsed, but the duration starts with an arbitrary positive offset.

mstevenson avatar May 01 '19 22:05 mstevenson

Filed: https://issuetracker.unity3d.com/product/unity/issues/guid/1152989/ Like @mstevenson said, this may have something to do with the startTime and duration value. But file separately just in case. Closing.

JiaUnity avatar May 09 '19 03:05 JiaUnity