facing direction that does not return to zero

I am new to Unity but still a very experienced Python coder and Maya Animator so forgive me if I ask stupid questions in UnityScript. :)

I am trying to develop a controller for moving the character around. Think of the set-up as controlling a radio controlled car and watching it from above, looking strait down at it. In the game the player moves the character along the ground along x and z axis. The camera, for now, is simply moved up 20 units and looking strait down at the character.

I can move the character around with a simple control script like the following:

var speed = 10;

function Update () {

    var horizontalInput = Input.GetAxis("Horizontal");
    var verticalInput = Input.GetAxis("Vertical");

    var xPos = horizontalInput * Time.deltaTime * speed;
    var zPos = verticalInput * Time.deltaTime * speed;

    transform.Translate( xPos, 0, zPos );

What I can't figure out is how do I steer the character in the direction of the motion? I've seen a couple of answers for something similar that I have tried but they all have one undesirable result, they return the character back to facing at it's origin (0 degrees north) when the motion stops. The problem I am running into is when the player stops, the car shouldn't magically return to facing up the Z-Axis, it should stay facing in the last direction it was moving in.

Also, I am applying the script to a generic GameObject with the geometry for the car parented underneath it. Should I be using a CharacterController instead?

I hope this all makes sense and any help you can spare would be greatly appreciated.

Thanks, Grant

var speed = 10.0;

function Update () {
    var xPos = Input.GetAxis("Horizontal") * Time.deltaTime * speed;
    var zPos = Input.GetAxis("Vertical") * Time.deltaTime * speed;

    transform.position.x += xPos;
    transform.position.z += zPos;

    var move = Vector3(xPos, 0.0, zPos);
    if (move != Vector3.zero) {
        var rotation = transform.rotation; 
        transform.rotation = rotation;

You're better off using "var speed = 10.0" or "var speed : float = 10", because otherwise speed is limited to integers (it's also a teensy bit slower, since the int has to be converted to a float every time it's used).

I changed the movement so it's setting the transform.position directly instead of using Translate. Since Translate is relative, the movement wouldn't work the same anymore when you change the heading.