I’m trying to *lerp *from one rotation to another using FRotator and FMath::Lerp function. I clearly do not understand how FMath::Lerp works and I would love if someone could explain it to me. Basically, I want my component to rotate from (0, 90, 0) being (Pitch, Yaw, Roll) to (0, 180, 0). When I do the FMath::Lerp from (0, 90, 0) to (0, 180, 0), the last returned FRotator is (0, 180.3, 0), which looks fine to me. But, when I call SetRelativeRotation and pass (0, 180.3, 0) as an argument, the rotation is set to (0, -179.7, 0).
Here’s the output log of the last 5 ticks of the lerp. The Before SetRelativeRotation is the value of the FRotator passed as an argument to SetRelativeRotation and After SetRelativeRotation is the value returned from GetRelativeRotation after calling SetRelativeRotation.
To me, this doesn’t make any sense! Can anyone explain this to me please ? Maybe give a quick solution ? Either way, it would be wonderful !
Thank you !