Rotation Clamping Issues

I am attempting to limit a given rotation within a certain range of the player’s viewpoint, in a manner similar to the way gun aiming works in Red Orchestra. I have started out with the yaw value, clamping it between Player View Yaw - Offset and Player View Yaw + Offset like this :
https://blueprintue.com/blueprint/yr1tawl0/

It mostly works as intended but the clamping seems to have issues when the rotation values get above roughly 330, or 30 and below (30 is the given offset value), and will only clamp to values outside that range. I’ve tried several workarounds but I just cannot get the clamping to work within this range. Any help would be greatly appreciated.

If I understand it correctly and your weapon is a child to your camera, you need to use Inverse Transform Rotation to effectively clamp it regardless the rotation of the player/camera.

I had the same issue when I tried to make a surveillance camera that would track the player, but limit its rotation. It would work fine within certain rotation range of the camera base, but when the camera base rotation was close to 360, it would break. So I eventually overcame it with Inverse Transform Rotation.

Here’s what it looks like in my case: Camera Rotation Clamped posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4

IDK if it will be helpful, but maybe it will nudge you into a right direction.

Thank you very much for your answer and posting your BP, I had attempted using that node in one of my workarounds but I didn’t fully understand what I was doing, so your template would help me alot.

Well, I seem to have figured it out, and the answer was simply to replace the ‘Clamp Float’ node with a ‘Clamp Angle’ node.