Download

Touch input held for X seconds

Hey everyone,

I’ve been trying to create UI buttons which pop up a small window with information when a player taps and holds on a button for a small amount of time (1-2 seconds). This type of thing is quite common in mobile games, however, I can’t seem to figure out how to do it for touch devices.

I’ve scoured old threads like this one: Input Held Down? - Blueprint Visual Scripting - Unreal Engine Forums and this one: Action on Button Held Down? - UE4 AnswerHub

and found how to do what I need with key inputs, using “Get Input Key Time Down”, however from my testing, this seems not to work with touch inputs.

Just as a test, I used the example in the above thread, and came up with this:

When I run the game and tap on the button, it flows to the “FALSE” result of the second branch, and prints 0.0 each tick regardless of how long I hold the button.

Am I just using this wrong? How can I track how long the player has held a tap on the screen? “Touch 1” on the “Get Input Key Time Down” node doesn’t seem to produce the desired result. Other people in the above threads have found it to work for their keyboard or controller inputs, but I have yet to see someone trying something similar for mobile.

Old Threat but hey ho, I was here today looking for an answer… I know believe I found one.

I have been looking around today how to set up my touch controller because the input when pressed the button was been automatically released, after trying different loops and gate functions I think I found a way that works simple fine.

To answer your question I am sharing with you a blueprint I am using at the moment, which I think is better because you are not calling the function at every tick but on a set time.

Also, I was only able to get rid of the autorelease glitch when I changed the interaction mode of the button to NOT be focused - Click MethodPrecise Click and Touch MethodDown and UP

Hope this works for you.
![alt text][1]

Thanks to this thing really helped me.