FPS Camera Constraint

I’m making an FPS but I’m having that problem where the user can do somersaults, walk upside down, is there a fix to this already implemented somewhere? Or how could I edit that to gt a more normal control?