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

**URL:** <https://forums.unrealengine.com/t/how-can-i-increase-a-character-speed-when-a-key-is-pressed-for-long-in-unreal-engine-4-27/1189752>\
**Category:** Blueprint\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [June 5, 2023, 4:19pm UTC](https://forums.unrealengine.com/t/how-can-i-increase-a-character-speed-when-a-key-is-pressed-for-long-in-unreal-engine-4-27/1189752 "2023-06-05T16:19:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EZShiven](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EZShiven](https://forums.unrealengine.com/u/EZShiven)\
**Post date:** [June 5, 2023, 4:19pm UTC](https://forums.unrealengine.com/t/how-can-i-increase-a-character-speed-when-a-key-is-pressed-for-long-in-unreal-engine-4-27/1189752/1 "2023-06-05T16:19:25Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![ZenOh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zenoh/32/629408_2.png) [@ZenOh](https://forums.unrealengine.com/u/ZenOh)\
**Post date:** [June 5, 2023, 4:57pm UTC](https://forums.unrealengine.com/t/how-can-i-increase-a-character-speed-when-a-key-is-pressed-for-long-in-unreal-engine-4-27/1189752/2 "2023-06-05T16:57:24Z")

</div>

> [@EZShiven](#):
>
> creates not-so-well animation

Animation:

> **[Blend Spaces](https://docs.unrealengine.com/5.0/en-US/blend-spaces-in-unreal-engine/)**
>
> Blend Spaces are graphs where you can plot any number of animations to be blended between based on the values of multiple inputs.

or increase character speed:

> **[Using Timelines to Change a Value Over Time | Community tutorial](https://dev.epicgames.com/community/learning/tutorials/zZ2P/unreal-engine-using-timelines-to-change-a-value-over-time)**
>
> This tutorial will look at how to smoothly move between two variables using Blueprints and provides step-by-step instructions on how to use a Timeline n...

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.
