Alternative approach using `FMath::VInterpConstantTo`

In the UE5 in C++ Developer course we were introduced to a method that can interpolate a vector to a location with constant step called FMath::VInterpConstantTo. Documentation is here.

For this lecture, I used that function to achieve the platform movement like so:

        FVector CurrentLocation = GetActorLocation();

        // New Location using VInterpConstantTo
        FVector NewLocation = FMath::VInterpConstantTo(CurrentLocation, CurrentLocation+TargetLocation, DeltaTime, Speed);
        SetActorLocation(NewLocation);
1 Like

Privacy & Terms