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