My solution to the relative rotation to open the doors

My solution was slightly different to the one presented in the lecture but works well. As far as I can tell, there should be no issues with it. One less line of code as well :grinning_face_with_smiling_eyes:

FRotator DoorRotation(0.f, FMath::FInterpTo(CurrentYaw, TargetYaw, DeltaTime, 2.f), 0.f);
CurrentYaw = DoorRotation.Yaw;
GetOwner()->SetActorRotation(DoorRotation);

Please feel free to give any feedback or criticisms. It’s all appreciated.

1 Like

Very good rotation!

1 Like

Thank you @Kevin-Brandon :slight_smile:

1 Like

You’re welcome!

Privacy & Terms