When using a timeline to interpolate an actor’s rotation, if I rotate it from anything to -180, once it reaches -180, it changes its rotation to 180. 180 and -180 are the same direction, but their being different values messes up the math I’m using to calculate other things based on the actor’s rotation.
I’m creating a camera movement system where the player can press A or D and they will rotate 90 degrees right or left. So if I try to clamp the values to always been between 0 and 360, it will change the direction the player rotates.
This is a good solution and I like it a lot, but since the new rotation is based on the rotation of the actor when the function is called, it breaks if the player calls the function again before the timeline ends, as the new starting yaw will not be a multiple of 90 anymore. I could add a “IsMoving” variable to prevent the player from inputting another rotation before the timeline ends, but I’d prefer to let the player move more freely.
Wow, that worked perfectly! I replaced the top-most GetActorLocation call with another MakeRotator using OldCameraYaw, so that the original rotation doesn’t change as the timeline runs.
On paper, I don’t think anything should have changed, because this is basically the same code. But I guess the rotator interpolation calculation is slightly different, which fixed this bug. Thank you!