Another possibility for DeltaRotator.Yaw if statement?

Hello there, this is my first post on the Unreal Engine with C++ course!

I’ve worked out the simple challenge using this code:

// Always yaw the shortest way.
if (FMath::Abs(DeltaRotator.Yaw) > 180)
{
DeltaRotator.Yaw = DeltaRotator.Yaw - 180.f;
}
Turret->Rotate(DeltaRotator.Yaw);

Did anyone else made this or something similar? Did it worked fine? up to now seems that is working fine.

Greetings!

Privacy & Terms