Smooth Character Rotation

is there way to rotate actor smoothly? heres example of code, when i use SimpleMoveToLocation() characters turns smoothly be4 move, but when im rotating actor myself it turns instantly, mb theres some function in character or pawn for that? i havent found it.



void APlayerController::Order(const FVector targetpoint)
{  
if (GetCharacter())
    {
        // Get Navigation System ref
        UNavigationSystem* const NavigationSystem = UNavigationSystem::GetCurrent(GetWorld());
        // Get Character Point
        FVector characterpoint = GetCharacter()->GetActorLocation();
        // Distance Between Character and Target Points
        float const Distance = FVector::Dist(characterpoint, targetpoint);
        // Check if far enough to move or close to rotate
        if (NavigationSystem && (Distance >= 100.0f))
        {
            // Order to Move
            NavigationSystem->SimpleMoveToLocation(this, targetpoint);
        }
        else
        {
            // Order to Rotate
            GetCharacter()->SetActorRotation(FRotator(GetCharacter()->GetActorRotation().Pitch, UKismetMathLibrary::FindLookAtRotation(characterpoint, targetpoint).Yaw, GetCharacter()->GetActorRotation().Roll));
        }
    }
}

The rotation “smooth” is normally managed by those parameter in your constructor:

GetCharacterMovement()->bOrientRotationToMovement = true; // Character moves in the direction of input...    
GetCharacterMovement()->RotationRate = FRotator(0.0f, 540.0f, 0.0f); // ...at this rotation rate

So if you set the input/velocity vector correctly, the pawn will rotate smoothly in the right direction.

SetActorRotation will set the “angle” right now if I remember correctly.
You might use the “set focus” if you don’t want to move but just rotate.

set focus is part of AIController right? I dont really get whut is AActor* Focal Point and how it works?