|
Hello, I'm getting an Error in Unity 3D. My first error was: "; Expected, please insert a semicolon". So thats what I Did in the correct spot. This was the error:
I Fixed that problem perfectly, but then. That created another error. This is a picture of it:
What am I Doing wrong. This is the script I'm trying to et working. Its a Mouse Look script: function Update () { if(RotationAxisRotationXY == RotationAxis.MouseX){ RotationX += Input.GetAxis("Mouse X") * sensitivityX * Time.deltaTime; RotationX = ClampAngle (RotationX, minimumX, maximumX); OriginalRotation = XQuaternion = Quaternion.AngleAxis (RotationX , Vector3.up); transform.localRotation = OriginalRotation * XQuaternion; } RotationY -= Input.GetAxis ("Mouse Y") * sensitivityY * Time.deltaTime; RotationY = ClampAngle (RotationY, minimumY, maximumY); OriginalRotation = YQuaternion = Quaternion.AngleAxis (RotationY, Vector3.right); transform.localRotation = OriginalRotation * YQuaternion; } static function ClampAngle (Angle: float, min: float, max: float): float { if(Angle < -360);{ Angle += 360; } if(Angle > 360);{ Angle -= 360;{ } return Mathf.Clamp (Angle, min,max); } }
(comments are locked)
|
|
In your function ClampAngle, there is a weird "{}" thing in the if (Angle > 360). i think you want to delete the "{" after Angle -= 360; and delete one of the "}" at the end of the method. EDIT : There is a ";" just after "if (Angle<360)" and "if (Angle>360)", delete them ! Nope, Thats not it.
Aug 08 '12 at 10:27 AM
Raxis
But why do you have these ? the return function is in a "if". Look at my answer again, I edited it.
Aug 08 '12 at 11:35 AM
KiraSensei
(comments are locked)
|


In the console, double click on the error so it will highlight the exact place in the script where the error happens.