I have a “Tap” action (yes I know this should be named an actual action that player performs in the game) which should respond only when tapping the touchscreen.
Action type is set to - Value
Control type - Touch
Interactions - Tap (values are the default).
And then I have simple code which should react OnTap.
When I run this on real device the message is called - However if I hold down the finger its getting called every “default time” that is set in the “Tap Interaction”, that is 0.2.
In Max Tap duration the ToolTip says as follows:
Time (in seconds) within with control has to be released again for it to register as a tap. If the control is held LONGER than this time the tap is CANCELED.
If I hold down I’m getting multiple tap messages instead of just one ( or not even that is it’s held longer than 0.2s).
Any idea why and how should I tackle this issue? I performed a test on one Android device (LG G3).
Hi, could this be of help for you? Complicated and overloaded
I had a similar issue with Button (which should be just a single press) and setting the “triggered” solved it
This is a problem with something that intuitively should simply work not actually aligning with how this works architecturally. We hope to make this clearer and more obvious as part of the upcoming work on gestures.
Binding to an entire touch control is taken very literally. What the setup here does is trying to read the entire touch control as a button and determine whether it was tapped. Obviously, that doesn’t really make sense. But there’s also no indication of the problem in the current editor.
To get taps from touches, you can either bind to the tap control on touches (such as “Primary Touch/Tap”; no tap interaction) or bind to the “press” control of either individual touches or the whole touch screen and then put a tap interaction on that. With this, you should see taps triggering the action correctly. However, you’ll then need to jump through some hoops (such as grabbing the parent TouchControl) to get to the position of the tap. We’re working on improving that side as part of the work on gesture support.