Simple run/sprint with shift key + animations

I’ve trying to solve this problem since a few hours, but I can not.
I want to create a sprint with the left Shift button. If it pressed, an animation plays and the speed goes up. If it held, an another animation plays as long as it is pressed. If it released the speed and the first animation plays fast to slow. I tried a lot, and searched here also, but I can’t find a version I understand, so sorry if I asked this for the 100th time.
Version: 4.8.3 and the Third Person template.
The last what I tried (do not laugh :D)

In the end I just created a speed change when I press or release the left shift key, but this is not too good. I am still looking for somebody’s help, how to add animations. There are a lot games (I think almost every 3d game) that use this kind of animation setting. For example Assassin’s Creed 3-4. You press something to walk, and you run simply when you not press anything. You run faster when you press something. And there is a great thing in that what I want to get. When I start the animation (I hold the shift to run faster) and imidiatelly release it, the animation won’t stop, it goes back to the normal run. I want to achieve this if it is possible for a beginner like me. (I know that the udk is able for this) Please if you can give me some hints or tutorial, I would be happy :slight_smile:

You need to use animation blueprints to implement proper animation mechanism. There are plenty of tutorials out there. directly playing animation is infeasible to scc achieve what you want . Only way is using animation blueprint with a proper anim graph

Ok, thanks :slight_smile:

Another way you may do it is to decrease your speed gradually when you release the run modifier key (usually shift). Take your current speed, drop it a few notches, wait 0.2 seconds or so, repeat until you are back at your normal speed. Make it a function, put it in a Timer and you’ll be all set with a gradual sprint to run or run to walk or sprint to walk or whatever.

The speed control is easy, as for the animations you will have to set that up yourself like Commander Shepard said.

I watched some tutorial videos about this, and blueprint, so I made a sprint function to the game. Thanks for the help :slight_smile: