Linear Interpolation Challenge Solution with a single FRotator

The following code using a single FRotator:

FRotator CurrentRotation = GetOwner()->GetActorRotation();
UE_LOG(LogTemp, Warning, TEXT("%s"), *CurrentRotation.ToString());
UE_LOG(LogTemp, Warning, TEXT(“Yaw: %f”), CurrentRotation.Yaw);

CurrentRotation.Yaw = FMath::Lerp(CurrentRotation.Yaw, TargetYaw, .05f);
GetOwner()->SetActorRotation(CurrentRotation);

2 Likes

Fantastic job completing the challenge.

Privacy & Terms