# Transform values stay zero while catching mouse movement

I am working on a game using GoogleVR, but I don't think that has anything to do with my problem.

Basically, I am testing to see if I can move a stick by using the mouse at the moment.

I am getting mouse movement, as seen from the value of md:

(-0.5,-1.25)
UnityEngine.Debug:Log(Object)
PlayerMovement:Update() (at Assets/Character Pack/PlayerMovement.cs:30)


But the transform is wrong, as seen from the localRotation:

(0,0,0)
UnityEngine.Debug:Log(Object)
PlayerMovement:Update() (at Assets/Character Pack/PlayerMovement.cs:29)


I just want to see my stick move in some predictable way based on the movement of the mouse, and I am not certain why my equation is wrong.

public class PlayerMovement : MonoBehaviour {
Vector2 mouseLook;
Vector2 smoothV;
public float sensitivity = 5.0f;
public float smoothing = 2.0f;

public GameObject stick;

// Use this for initialization
void Start () {
smoothV.x = 0.5f;
smoothV.y = 0.5f;
}

// Update is called once per frame
void Update () {
var md = new Vector2 (Input.GetAxisRaw ("Mouse X"), Input.GetAxisRaw ("Mouse Y"));

md = Vector2.Scale(md, new Vector2(sensitivity * smoothing, sensitivity * smoothing));
smoothV.x = Mathf.Lerp (smoothV.x, md.x, 1f / smoothing);
smoothV.y = Mathf.Lerp (smoothV.y, md.y, 1f / smoothing);

stick.transform.localRotation = Quaternion.AngleAxis (-mouseLook.y, Vector3.right);
stick.transform.localRotation = Quaternion.AngleAxis (mouseLook.x, stick.transform.up);
Debug.Log ("(" + stick.transform.localRotation.x + "," + stick.transform.localRotation.y + "," + stick.transform.localRotation.z + ")");
Debug.Log ("(" + md.x + "," + md.y + ")");
}
}


Firstly, you're storing your mouse movement in md, and debugging its contents to make sure it got set properly, but not using it at all for rotation. Your rotation code is using a completely different variable mouselook which so far as I can tell you never populate with any non-zero values.
Then your rotation code sets localRotation with your pitch rotation... then immediately overwrites this with a yaw rotation, so the first line setting localRotation might as well not be there — the very next line replaces whatever it tried to do. Did you mean to combine these two partial rotations using multiplication or Quaternion.Euler?
Your rotation debug only looks at the x, y, and z components of the localRotation quaternion, which won't be very informative. These components hold the axis of rotation, scaled by the sine of half the angle — which is very nearly zero for small angles. To get a more intelligible human-readable value, you might want to check transform.localEulerAngles instead.