- Home /
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
Answer by Wolfram · Feb 04, 2013 at 08:32 PM
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: http://answers.unity3d.com/questions/46496/mouselook-min-max-problem.html
Your answer
Follow this Question
Related Questions
Mouse look and character model? 1 Answer
Mouse look Y axis sensitivity doesn't change 0 Answers
Mouse Look Script Help 2 Answers