How can i increase a character speed when a key is pressed for long in unreal engine 4.27

I have created Animation BP but I need help increasing a character’s speed gradually when a key is pressed for a long unless it reaches a particular float value and decreases it when released.

I want this because when pressing the left on my keyboard the max walk speed changes very quickly which creates not-so-well animation…

Animation:

or increase character speed:

Add a Timeline with a float curve to “1” sec (replace “1” with your push time), set in the curve 1. key (time 0, value 0) 2. key (time “1”, value 1). In the Timeline output, connect the float to a “Lerp” and pin it to the Alpha. Set A to your current speed and B to the speed you want. Connect the output node from Timeline update to the set MaxSpeed node.