How to get elapsed time since button pressed?

Guys,i cant find a solution to this and it seems it would be so simple.I setup this blueprint so i can have slow motion and it works,but i want the transition to be smooth,so i need the time dilation float value to go from 1.0 to 0.15 smoothly.I already created a curve float but i can’t find a way to know the elapsed time after i press my slow motion key(i need to know so i can tell this value to the float curve and it can make the transition accordingly.)Please,i cant find help anywhere else,can someone help me?

Hey,

if you have boolean that says whether you are in slow-mo or not, then just interpolate float value between 1 and 0.15 in Tick method. You can use this node: http://api.unrealengine.com/INT/BlueprintAPI/Math/Float/Lerp/

Then you can use DeltaTime in the Tick method to change value of Alpha, let’s say you want to change value by 0.5 per second (that means that you get from 1 to 0.5 in 1s), you can compute alpha value for each frame as:

lerpSpeed = 0.5

currentAlpha = currentAlpha - deltaTime * lerpSpeed

(or use + if you wanna get from 0.15 to 1)

Hope it helps.

When you press your button you can “Set timer by Event” and use the output of this to “Get Timer Elapsed By Handle”.

This will give you the duration since the last press.

Drag off the red event parameter for the Set Timer node and type “Custom Event” and make a new one. You can have this event do something if you wish.

If you want to avoid using the Tick node, you can try looking at timelines. It would be a good way to get the values you need for the specific time range you want. Here’s the documentation page for Timelines and a good tutorial on timelines

fair point there :slight_smile:

thank you people very much,now i have my problem solved!