MouseLook restrictions not working

Hello all, I am using the default MouseLook script (supplied with unity) with my camera but when I try to restrict the x axis, it still rotates 360 degrees. The Y axis restrictions are working fine. Any help would be wonderful.

Script: MouseLook

Axis: MouseXandY

Sensitivity x: 6

Sensitivity y: 6

Minimum y: -10

Maximum y: 10

Minimum x: -15

Maximum x: 15

The script is buggy, minX/maxX are never used.

Edit the script and look for the first appearance of “Clamp”. Copy that line and replace each Y with X:

rotationX = Mathf.Clamp (rotationX, minimumX, maximumX);

EDIT: Or use @Eric5h5’s answer/comment from here: MouseLook - Min & Max Problem - Questions & Answers - Unity Discussions