top-down shooter rotation

I attached the following code to my main player and it won’t rotate, and there aren’t any error showing up. Does anyone know why?

#pragma strict

var speed: float=20.0;
var rotatespeed:float=2.0;

function update(){
var controller:CharacterController=GetComponent(CharacterController);
transform.Rotate(0,Input.GetAxis(“Horizontal”) * rotatespeed, 0);

var forward :Vector3=transform.TransformDirection(Vector3.forward);
var curspeed:float=speedInput.GetAxis(“vertical”);
controller.SimpleMove(forward
curspeed);

var position=Input.mousePosition;
var newposition = Vector3(position.x, position.y, camera.main.transform.position.y-transform.position.y);
var lastPosition = camera.main.ScreenToWorldPoint(newposition);
transform.LookAt(lastPosition);
}

@script RequireComponent(CharacterController);

Update not update

capitalization is important… also Vertical not vertical

Thx so much, I feel so dumb

also, is there a way not to rotate along the Z axis, it seems that it would rotate along x y and Z

With lookat() the transform’s z axis, always faces the target. There are a few threads on it.

https://www.google.ca/search?q=unity+lookat+limit+axis&ie=UTF-8&oe=UTF-8&hl=en&client=safari