This is one big weird issue. Take rotation for example: say I have Roll rotated my character, and I want to reset the roll rotation to 0.
The normal way to go about it would be:
APlayerController* pc = Controller->CastToPlayerController();
pc->SetControlRotation(FRotator(pc->GetControlRotation().Pitch, pc->GetControlRotation().Yaw, 0.0f));
However, that won’t work. The function is executed, however no rotation takes place. So I decided to try something else:
APlayerController* pc = Controller->CastToPlayerController();
while (pc->GetControlRotation().Roll != 0.0f){
pc->SetControlRotation(FRotator(pc->GetControlRotation().Pitch, pc->GetControlRotation().Yaw, 0.0f));
}
And usually after 2-3 calls, the roll gets to be 0.
I’m using the code in the Tick method. I’m obviously not executing it every time tick gets called, but I am trying to execute it when roll !=0.
In the end, I tried debugging and went through the method calls, all looks fine except the fact that the rotation only really takes place after the second, third or forth call.