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));
}
}
}