transform.rotate (quick question)

Hey, what I am trying to do is this:

I want the object to rotate along the x axis when I move my mouse (so the object rotates horizontally whilst corresponding to my mouse movements). However, with this script at the moment, all it seems to be doing is spinning vertically, can anyone point me in the right direction please? :slight_smile:

 var rotateSpeed : float = 1.0;

 function Update(){
      transform.Rotate(Vector3(Input.GetAxis("Mouse X"), 0) * Time.deltaTime * rotateSpeed);
 }

Thank you :slight_smile:

It’s not exactly clear what you want to happen here. “Rotate” and “Spin” are really the same thing, so the only change needed to rotate horizontally is getting your input value to be the right one in the Vector3.

E.g.

var rotateSpeed : float = 1.0;

 function Update(){
      transform.Rotate(Vector3(0, -Input.GetAxis("Mouse X"), 0) * Time.deltaTime * rotateSpeed);
 }

rotates horizontally according to mouse movement just fine (if somewhat slowly).

Is this what you wanted to happen?