Camera problem in rolling ball game with custom gravity (gimbal lock?)

So, I’ve been working on creating a rolling ball game with a dynamic gravity system and have run into a problem.

I trace to the ground to get the angle of the floor the pawn is on and with “make rotation from axes” create a new rotation for the camera so that the new ground is the new “down” direction. The problem is now that if I try to move the camera it moves relative to the world and not relative to the new plane.

Here’s a small video to illustrate the problem:
And here’s my blueprint: Imgur: The magic of the Internet

I guess what I am looking for is a camera control scheme that moves the camera relative to a custom plane, but I can’t get it to work. I tried implementing this:

but it didnt work.

Hopefully someone can help me out!

Hey!

If you don’t want to end up facing the problem over and over again, you need to add to a rotation instead of setting it. I used to set absolute rotations in the past, but I only got it working using added rotations. Nodes like AddLocalRotation, AddLocalWorldRotation and other nodes can solve your problem. There are other solutions out there with combine rotators and such, but it never really worked out for me :).