Answers for "Mouse Look Limit"
http://answers.unity.com/questions/118437/technical-question-mouse-look.html
The latest answers for the question "Mouse Look Limit"Answer by Edy
http://answers.unity.com/answers/119538/view.html
Use this script for clamping the angle. Works with any input values.
function ClampAngle (a : float, min : float, max : float) : float
{
while (max < min) max += 360.0;
while (a > max) a -= 360.0;
while (a < min) a += 360.0;
if (a > max)
{
if (a - (max + min) * 0.5 < 180.0)
return max;
else
return min;
}
else
return a;
}
It's not mine, I think I got it at UnifyCommunity. I also had problems when setting limits to MouseLook, but using this function for clamping the angle worked perfect.Fri, 20 May 2011 23:53:26 GMTEdy