Script isn't running

I have a script attached to the pelvis bone of a character, but it isn't running. The script is supposed to control the animation (when I check play automatically, it runs fine, so I don't think its an animation issue). This is the script

var player : GameObject;

function update()
{
    var distance: float;
    distance = Vector3.Distance(transform.position, player.transform.position);

    if(distance > 5)
    {
        animation.Play("idle");
    }
    else
    {
        animation.CrossFade("walk");
    }

    if(distance <= 1)
    {
        animation.CrossFade("attack");
    }

    print(distance);
}

I don't get any complier errors, and nothing prints. Any suggestions?

Change update() to Update(). It's case-sensitive.