Basically my character move from platform to platform in a single “dash” or “rush”, I aim at the platform, click fire and the player move toward that position at a certain speed until a collision happens, in which case the player will stop moving.
Now what Im trying to set up is something I call an “insta-dash”, which is basically, if the player reclick somewhere in the 1 or 2 seconds following a collision, than he will instead insta-dash, which is basically just dashing at a faster speed. If he fails to input fire during that 1 or 2 second time, then he will instead do a regular dash.
Can somebody help me set it up? I don’t know what node to use to compare and stuff. Visual help would be much appreciated
Most functions are available in blueprint as well, you can use it after collision to set a boolean to true and another event(delegate) to set boolean to false.
However, you can only have 1 timer for 1 event/function, try to set another timer will reset the existing one.
Thanks for the answer, altough im having trouble setting it up in blueprint.
Would it be possible to provide visual example of what I should be doing?
It may hit the performance slightly harder (not sure, if it does then it seems negligible), but it’s much more intuitive IMO to use Timelines instead.
Timelines are super flexible and are really really solid in terms of their firing rates (moreso even than delta-compensated tick), it’s pretty trivial to use them too.
To create your window, you simply have the press/release commands for your click input set and unset a variable. Then when you want the window to open (i.e. after collision), first unset the “pressed” variable for your click so clicks before the window don’t register, start a timeline (play from start) and have its “update” pin shoot into a branch that checks if “pressed” is true (i.e. You must press click AGAIN during the window).
By setting the Timeline’s length you can adjust the length of the window for insta-dashing.
I use Timelines for all sorts of stuff like this; I think the control BP for my player character has over two dozen timelines used for various things of this nature (making certain attacks cause the character to float for a period of time, checking if a button has been held for a certain length of time or if it’s been pressed in a certain window, checking if one variable goes true within a certain time of another going true, etc) and it doesn’t have any appreciable impact on my game thread ms.
this is my timer delegate solution, as RhythmScript said, timeline is also valid.