Question in regards to the usage of FRotators

Hey guys. I’m trying to get my head around the syntax of the FRotator library. So far, I haven’t had too much luck with it.

For example, I’m trying to Normalize a rotator, the structure would seem (Intuitively) as follows:

FRotator Rot = PreviouslySavedRot.Normalize(); 

However, this results in the error C2679 “No operator found… No acceptable conversion.” I do understand that it is not

FRotator::Normalize(PreviouslySavedRot)

since there are no arguments to be taken by functions of this type.

I know that they can be in their own line:

PreviouslySavedRot.Normalize();

But I’m not sure if then to get a Return value I’d have to Set the Rot variable just be equal to the Normalized Operation.

How do I properly Syntaxize FRotators?

If you have function supposly change the structure and it has no return (void return) then that means that function changes data inside the structure, so:

FRotator Rot = PreviouslySavedRot; //Lets create copy of rotator
Rot.Normalize(); //Then call Normalize.... and you done :) rot is now normalized
UE_LOG(LogTemp,Log,*FString::Printf("%s - %s",PreviouslySavedRot.ToString(),Rot.ToString())); //...to see the proof in logs

So in your case PreviouslySavedRot got normalized.