Keeping Camera relative to Actor Vectors? Maintaining mouse-up == look-up?

Hey all, this is my first time asking for help through here, so hopefully it’s legible. I’m working on a space game where you are controlling a ship with keys and look around freely with a basic spring-arm camera. This is all well and fine until I want to clamp how far down I can look(so I don’t look straight down into the ship or straight up). I managed to clamp the pitch until I changed the pitch of the spaceship and realized the clamp was to the world space, not the ship. In comes the DOT logic using the up and forward vector(successfully) to clamp the spring-arm. However, now that the camera isn’t a basic free camera, just about any looking around while rolling destroys the calculations. Not to mention, if I want to turn the spaceship upside down, the controls get all inverted.

Ultimately, I’ve tried about 5 different ways of going about a camera attached to an actor that can move and rotate on any axis, and I just want a bone thrown my way.

I would like to be able to turn upside down while maintaining the same view controls on the ship.
I would like the pitch on those view controls to be clamped(Which I pretty much have dialed with the DOT Logic)


What I have here isn’t functional; it just happens to be where I’ve thrown in the towel. It was working better when I kept the 3 mouse axes as floats and worked with them individually; however, it still wasn’t working when rolling/going upside down.

Any help is greatly appreciated!

I have this screenshot from a few modifications ago. This version works better than the one in the OP and is more polished, which might help pinpoint the issue.