How do I avoid buggy rotation?

I’m making a line trace from the center of the camera towards the ground and rotating a turret towards that location.

It works fine until I point the camera at 90 degrees where the rotation proceeds to flip to -270 degrees and the rotation spasm out of control.

How can I avoid this?

You basically have to never read the rotation from the turret. Just store the turret rotation in a variable at the start, and only add ( or subtract, same thing ) rotation to it using ‘AddLocalRotation’