// Opens door
void UOpenDoor::OpenDoor(float DeltaTime)
{
CurrentYaw = FMath::FInterpTo(CurrentYaw, TargetYawOpen, DeltaTime, 2);
FRotator DoorRotation = GetOwner()->GetActorRotation();
DoorRotation.Yaw = CurrentYaw;
GetOwner()->SetActorRotation(DoorRotation);
}
// Closes door
void UOpenDoor::CloseDoor(float DeltaTime)
{
CurrentYaw = FMath::FInterpTo(CurrentYaw, TargetYawClose, DeltaTime, 8);
FRotator DoorRotation = GetOwner()->GetActorRotation();
DoorRotation.Yaw = CurrentYaw;
GetOwner()->SetActorRotation(DoorRotation);
}