Object not rotating

Hi, I have this script here:

var speed = 2;
var rot = 0;
function Update () {
	rot += Input.GetAxis("Horizontal")*speed *Time.deltaTime;
	var z = Input.GetAxis("Vertical")*speed *Time.deltaTime;
	transform.Translate(0,0,z);
	transform.Rotate(0,0,rot);
}

What it’s supposed to do is rotate the object if you press left or right, and also move it if you press up or down.
The problem is the object won’t rotate. I’ve added a print(rot) after the transform.Rotate line, but it always prints a 0. What am I doing wrong?

You made “rot” an int, and are trying to add a fraction to it, so it will always remain 0. Also, unless you meant that the rotation speed should continuously increase the longer you rotate, you should do it this way:

var speed = 2.0;

function Update () {
    var rot = Input.GetAxis("Horizontal")*speed *Time.deltaTime;
    var z = Input.GetAxis("Vertical")*speed *Time.deltaTime;
    transform.Translate(0,0,z);
    transform.Rotate(0,0,rot);
}

It works! Thanks for the help!
EDIT: Shouldn’t this be below your reply?