Execute on Key Press

Hello everyone,

In this blueprint, as soon as I hit “K”, it only executes once, and won’t finish until “FInterp To” is set to it’s given “Target Position”
What I am struggling with is the fact that I am trying to find a way, to make Key Press “K” (Just once) set Boolean “Engine On” false, making it finish from it’s current “Playback Position” to “Target Position”

Right now I could either get it to reach that “Target Position” by holding the “K” button using “Event Tick”, or by keep pressing the “K” button over-and-over again, which is obviously not what I am looking for!

Thanks in Advance!

Hello,
I maybe wrong but for me the issue comes from your timeline which finishes to execute the order. I would try to send a stop / set new time / play and see.

Thanks for your Input Fen,

But that does not seem to make any difference. I would still have to keep hitting the “K” button over-and-over again to reduce it’s value until “Target Position” 1.25 is reached. Hopefully there is a possibility!

Anyone else having an idea?

Maybe:

“K” Press -> “Do Once” (Engine On == true resets it) -> Engine on = false

Event Tick -> Make a Update Function with: If Engine On == false -> Get Playback -> Set New Time

So you dont have to keep K pressing

Oh wow. I looked at this once already but apparently completely blacked out.

The issue is your interpolation. It takes as input the current delta seconds and will smoothly transition between your current and target. However for this to work you need to continuously call it.
Maybe another timeline could solve this issue which simply slowly iterates between those two points… or hang it up at an event tick and only work with a bool… though that is not an ideal solution…
There is probably another way though I’ve worked very little with timelines and this type of stuff. However the source of all evil should be found and hopefully you will be able to banish it to the depths it came from :smiley:

Cheers

Thanks for the input people!

I’ve got it to work using Event Tick on Sequence,
Then 0 -> Add Actor Local Rotation
Then 1 -> Branch “Engine On == False” -> Set New Time.

Without Event Tick on “Add Actor Local Rotation”, nothing moves, and when Connecting Timeline’s Update to “Add Actor Local Rotation”, it only moves on a Key Press.

May need to find a solution around using Tick Events.