Rotating actor when camera's relative rotation is outside -45 and 45 degree

I’ve been at this for a while now and finally decided to ask because I’m starting to lose my mind. So I want the camera to rotate freely if its relative rotation is between -45 and 45 degrees but when it goes past that I then want to rotate the actor. I have a working version of this.


The blueprint is quite messy because at some point along the line I just started brute forcing it. Anyway this blueprint kind of works but has a problem when crossing -180 to 180. It just snaps to rotation for some reason. So any help and explanation would be nice.

What you’re looking for is Turn in Place using Root Bone Yaw Offset.