Having trouble with Navmesh rotations

So I followed the beginner navigation tutorials here on the site for NavMesh’s and the baking and movements for my character and plan to also use it for my AI. But I am having one problem. I can’t get my character to rotate to face the direction he is walking. I tried using the agent updateRotation but it keeps coming up with errors. How am I wrong in my assumption that the following should work?

private var agent: NavMeshAgent;

function Start () {
    agent = GetComponent.<NavMeshAgent>();
}
   
function Update () {
    var hit: RaycastHit;
    // When the mouse is clicked...   
    if (Input.GetMouseButtonDown(0)) {
        // If the click was on an object then set the agent's
        // destination to the point where the click occurred.
        var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
       
        if (Physics.Raycast(ray, hit)) {
            agent.SetDestination(hit.point);
            agent.updateRotation;
        }
    }
}

Still haven’t figured out the rotation if anyone minds helping.
I set agent.updateRotation = true;
But still haven’t figured it out.

Hmmmm nevermind. Figured it out. It is working now. For some unknown reason it wasn’t working until I deleted my player model and redid all the components. Not sure what was wrong, but now the char automatically rotates. Though I noticed the x rotation is off. So I ended up putting my player in the correct rotation inside an empty object.