I here today to know if someone can find an answer about my problem :
I got a pawn (a mech) and with that one you can press the shift button to “cast” (it disable some movements) and then when you released the shift button, you make a quick dash forward.
All is ok but I can’t find how to tell : "hey ! press the button while 2sec ! if not the cast will be break and not launch the dash !
so you want to release the cast only if you pressed the button 2 seconds long other wise its not launched? make a timer that activate a bool after 2 sec. and only if this bool is true you can cast after release. if you release before cancel the timer “clear timer by handle”
It is good practice to avoid using the event tick as you did, becausee it check every frame for that bool to be true or false, if you use the event tick too much it can result in poor performance.
if you run the game at 60 fps. It will check that bool 60 times per second, if you do too many of these on too many BP, it will cause problems.