Download

Set sprinting variable

Hi, I followed the FPS tutorial here: A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums

After doing so, I wanted to implement sprinting. I made this by adding 2 new input handler things and creating the two voids for key press and key release, then doing in key press:
GetCharacterMovement()->MaxWalkSpeed = 1800.f;

Then when the SHIFT key is released, set it back to 600.f (the default max walk speed).

This is all good, except I needed to have a sprint animation run instead of the default run animation.
I duplicated the FPP_Run animation given by the tutorial and called it FPP_Sprint then made the speed a bit faster.

Now I have to actually play the animation if they are sprinting.

Here is my blueprint currently:
eeabfbe74be4311150e6b9a42c22feb77f09f7d9.png
As you can see, I created isSprinting variable.

I also had to add the Sprinting state:
81d807e51b40d82e7a8d5ee5a9b19798e68d1f02.png

But how do I instead of setting isRunning true if the velocity is greater than 0, set isSprinting to true if the velocity is greater than 0 and the max walk speed is greater than 1000 (roughly), if not true for either/both of those statements, set isRunning to true if the velocity is greater than 0.

Never mind, I figured it out.

Here’s how, if for someone reason someone else wants to know: