Window Time to press input after an Hit Event
After some time digging on the net without working result, i'm asking you for some help.
What i want : After an hit event, i want to let a window time to press a key and if it done in time, do the adequat reaction.
Example of application : When i hit a wall during a jump (so i get an hit event an know that it's a wall and i'm falling), if i pressed my jump key during the 3s after the hit (random time for the example) i made a wall jump.
I hope it's clear
asked Oct 08 '18 at 08:54 PM in Blueprint Scripting
Create a boolean variable bCanWallJump.
IN the Hit event, set bCanWallJump to true, and also Set Timer by Event (set it to 3 seconds).ALSO store a reference to this Timer in another variable WallJumpTimer.
Connect the red pin of the Set Timer node to a Custom Event, and on that event's execution, set bCanWallJump to false.
When player hits the jump button then check the bCanWallJump variable. If it is true, make the pawn wall jump. If it is false, don't.
When the player wall jumps or lands on the ground or anything else like that, then set bCanWallJump to false AND use that WallJumpTimer variable to stop, reset, and/or invalidate the timer so the player can't wall jump when they're not on a wall.
answered Oct 08 '18 at 11:45 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here