So I use the code below to generate a Yaw rotation value so I can make my characters spine face the direction pushed on the right stick.
FRotator MyRightStickRotator = RightStickDirection.Rotation(); MyRightStickRotator.Yaw -= 90; const FRotator CameraRotation = FollowCamera->GetComponentRotation(); const FRotator YawRotation(0, CameraRotation.Yaw, 0); MyRightStickRotator.Yaw += CameraRotation.Yaw;
The problem is, when I debug it, it gives me a value of 0 in the Xaxis, but then as I rotate clockwise it goes to 135, then -225, then around to -1 then 0. I was expecting it to go from 0-180, then -180 to 0.
How would I stop this from happening please?