Have a character face their moving direction?

I am workng with this script

var controller : CharacterController = GetComponent(CharacterController);

var forward = transform.TransformDirection(Vector3.forward);

var curSpeed = speed * Input.GetAxis ("Vertical");

transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 8);

controller.SimpleMove(forward * curSpeed);

It works by rotating the player with the left and right arrows, and actually moving the character forward/backwards with the veritcal keys. How do I manipulate THIS script to make the character walk AND face a direction with the left and right keys just like the forward and backward keys?

I've tried making a 2nd curSpeed var:

var curSpeed2 = speed*(Input.GetAxis("Horizontal");

but I am lost when it comes to plugging that in to the rest of the code...

controller.SimpleMove(forward * curSpeed + curSpeed2);

doesn't work.

Any help is appreciated!

Here is the easiest way:

if(forward.magnitude > .2) {
//Add a conditional to prevent snapping back
    transform.forward = forward;
    //Set the transform's forward Vector to your move direction.

There are move complicated things you can do with rotation if you want different effects such as smooth rotation, but this will have your character snap to the direction they are moving.

//Off the top of my head
//There are some snapping back issues, you would need to rearrange variable's scope and conditionals.
//So, sorry, this code is only partially functional.  It's more about the concept.    

if(forward.magnitude > .2) {
//Add a conditional to prevent snapping back
     var desiredRotation = Quaternion.LookRotation(forward);
     transform.rotation = Quaternion.Slerp(transform.rotation, desiredRotation, Time.deltaTime);