Camera flips when passing the 90 pitch mark

Hi everyone! I’m currently working on a project in which the player flies a plane using keyboard and mouse. I need the camera to stay always horizontal to the floor, but everytime the camera crosses the 90/-90 pitch point, it flips. I’ve tried making my custom PlayerCameraManager, but it didn’t help a lot.

Here’s an example of what is happening: Screen capture - e5d3ad18ab6f01e445642984af85e464 - Gyazo

Any ideas on how to solve this? Thanks in advance!

Need to see some code, dude.