raycast doesnt seem to collide

i cant seem to get my door to animate upon raycast collide the script is attached ot my fps
controller heres my script.

var rayLength = 6;
function update ()
{
  var hit = RaycastHit;
  
  if(Physics.raycast(transform.position, transform.forward, hit, rayLength))
  {
    if(hit.collider.gameObject.tag == "door")
    {
      hit.collider.gameObject.animation.Play("door_open");
    }
  }
}

You have called your function update() but it needs to be called Update() or it won’t be called by Unity.