How to deal with -90° pitch ?


Anyone has a clean way to deal with pitch at -90° in rotations ?

Each time i use a -90° pitch i get problems:

  • forcing a player camera to look down -90° => the view becomes glitchy
  • setting a custom relative rotation for a mesh in a blueprint with a -90° pitch => yaw and roll take random values at runtime as soon as a “transform modifying” function is used.

Now i get that with a right angle pitch, yaw and roll are ill defined so i don’t blame the engine for getting this wrong, math is math.

My question is: is there any clean workaround for this like some option in the config files to force the engine to work its rotations in a rotated reference frame, or use a different set of coordinates, anything where a -90° pitch makes sense ?

For the moment all i could find is to limit my pitch to -89°.
It’s hardly noticable for meshes, and not too much of a problem for camera, so it works ok.

But it’s not a clean solution: i get those strange -89° angles in my code/blueprints and soon i’ll forget where those came from.
I did put comments in my code, but in the BP UI the knowledge will be lost:

Anyone has a better suggestion ?