I tried this code for my actor rotation change (10, 20, 30) to (100, 200, 300).
void AMyActor::SetMyRotation()
{
FRotator RotB = GetActorRotation();
UE_LOG(LogTemp, Log, TEXT("Rotation(Before): %f, %f, %f"), RotB.Roll, RotB.Pitch, RotB.Yaw); // Correct
FRotator MyRot;
MyRot.Roll = 100.0f;
MyRot.Pitch = 200.0f;
MyRot.Yaw = 300.0f;
//SetActorRotation(MyRot);
SetActorRelativeRotation(MyRot);
FRotator RotA = GetActorRotation();
UE_LOG(LogTemp, Log, TEXT("Rotation(After): %f, %f, %f"), RotA.Roll, RotA.Pitch, RotA.Yaw); // Wrong?
}
But, I don’t get the correct rotation (100, 200, 300).
(SetActorRotation() &SetActorRelativeRotation() are same result.)
How can I do it?
Thank you.