I searched all relative questions on this topic and i couldn’t find something useful. I use 4.15 and the pitch rotation bug is still there. My problem is not Gimbal Lock . My Actor just stops pitch rotating at (-)90 degrees. I tried SetActorLocation, LocalRotation,SetWorldRotation,SetActorRelativeLocation and every time i get the same result. I even tried quaternions.
I looked a bit in the source code and saw, that the rotator is eventually turned into a quaternion. So when you call GetActorRotation, this quaternion is transformed back into a rotator, but because of mathematical reason I don’t understand, the pitch angle is clamped between -90 and 90 degree.
(Yaw and roll seem to be calculated with an atan2, which ranges from -180 to 180 degree, and pitch seem to be calculated with an asin, which results in a range from -90 to 90 degree. But again, I have no understanding about the mathematical reasons why to use asin and atan2.)
In the source code I could find references to this quaternion-to-rotator-transformation, perhaps they are helpful for you. And the function is question is FRotator FQuat::Rotator() in case you want to look it up.