Question by 
               miramaslow · Dec 01, 2015 at 06:18 AM · 
                c#camera rotatefirst person controller  
              
 
              How to stop the character from rotating around?
As the question above, my capsule keep rotating non-stop after i put this script to my capsule. Any help would be appreciated
 public class MouseLook : MonoBehaviour {
     
     public enum RotationAxes { MouseXAndY = 0, MouseX = 3, MouseY = 5 }
     public RotationAxes axes = RotationAxes.MouseXAndY;
     
     public float joysensitivityX = 3F;
     public float joysensitivityY = 3F;
     
     public float minimumX = -360F;
     public float maximumX = 360F;
     
     public float minimumY = -60F;
     public float maximumY = 60F;
     
     float rotationY = 0F;
     
     
     
     void Update ()
     {
         
         float Xon = Mathf.Abs (Input.GetAxis ("Joy X"));
         float Yon = Mathf.Abs (Input.GetAxis ("Joy Y"));
 
         if (axes == RotationAxes.MouseX)
         {
             if (Xon>.05){
                 transform.Rotate(0, Input.GetAxis("Joy X") * joysensitivityX, 0);
             }
         }
         if (axes == RotationAxes.MouseX)
         {
          if (Yon>.05){
                 rotationY += Input.GetAxis("Joy Y") * joysensitivityY;
             }
             rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
             
             transform.localEulerAngles = new Vector3(-rotationY, transform.localEulerAngles.y, 0);
             
         }
     }
 }
               Comment
              
 
               
              Answer by Arju2011 · Dec 01, 2015 at 08:29 AM
A question just like this was answered 10 hours before you asked this, his answer is the same as mine, you need a LateUpdate() function. http://answers.unity3d.com/questions/1105598/limit-rotation-angle-on-z-axis-while-slerp.html
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                