Hi!
I am trying to make a system where when I press the sprint key, instead of instantly going to my sprint speed, it would gradually go from walk speed to sprint and crouch and prone would do the same but with the added height change.
I already tried using timelines and it worked perfectly until I went from sprinting to crouching where when I try to crouch it first stops the sprint which reverses the sprint timeline and right after plays the crouch timeline but as the stop sprint is little bit longer than crouching the final character speed instead of being the crouched speed would be the walking speed (when the sprint timeline reverses it goes to the walking speed) because the stop sprint ends after the crouching.
I imagine I could just tweak the times so they finish when they should but I am almost certain that thereâs a better way to do that and also I donât plan on using animations for now.
Any help would be really apreciated!
You could use finterp.
The moment the relevant key gets pressed, a new target speed is set and the code moves between speeds like this
You just set ânew max speedâ when a key is pressed.
Youâll need to twiddle with the inter speed to get it to your liking. If you want a more timeline feel to it, you can also try

Thx for the reply and sorry for mine being late!
I am using C++ and tried to convert your blueprint code to C++ and either I did it wrong or it is not working.
**Tick Function**
void APlayerChar::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
UE_LOG(LogTemp, Error, TEXT("Current Speed = %f"), GetCharacterMovement()->Velocity.Size());
GetCharacterMovement()->MaxWalkSpeed = FMath::FInterpTo(currentMaxSpeed, newMaxSpeed, DeltaTime, 1.f);
}
**Stance handling function**
void APlayerChar::handleStanceChange(EStance RequestedStance)
{
if (RequestedStance != currentStance)
{
switch (RequestedStance)
{
case EStance::sprinting:
currentMaxSpeed = 500.f;
newMaxSpeed = 850.f;
break;
}
}
}
The problem is that when I sprint the max speed only goes up to â505.XXXXXâ instead of 850 and if I set the interp speed to 10 then i goes to â55X.XXXXâ.
I also tried Interp to constant and it did not work.
The system I used to have was using a Lerp and timeline and only had problems when the timelines overlap. Is there someway to make a function wait for a timeline to end?
Edit: And also if it is possible not to use the tick function? I am a big noob and I learned/heard that using Tick is a bad practice
Afraid Iâm not a CCP ocifionado :-/
Tick for a small calculation like this will not use resources. Youâll find it a much more elegant system, once you get it working 
All you need to do it set the ânew max speedâ and the interp will shoot right there.
Not at a machine right now, but on that tick node, itâs just
Tick â finterp â set character max speed
I should be able to check it out laterâŚ
Thank you for that resource and Iâll continue to try and make it work!
In your CPP example, the âcurrent max speedâ needs to read from the character, every tick 
( it needs to be a live sample ).
PS: To be clear, thereâs no rule about reading it from the character, but it does need to be the actual current max speed. How you do that is up to you, but it will basically mean setting the speed on the character every tick and either reading it again, or reading it from a variable youâre using to set the speed.
Wow I canât believe Iâm this blindâŚ
Thank you so much, you are a life saver I canât believe itâs been nearly 2 days that I was trying to solve this and the solution was that simple.
Again THANK YOU!