NavMeshAgent enemy not following player in Unity 2020.3

I’ve been working on a shooting game with some friends, and I’m trying to enable the enemies to track the player using NavMesh. However, the enemy remains stationary instead of moving.

I’ve attempted to reconstruct the navigation mesh, modify the enemy’s configuration, and refer to the Unity documentation, but none of these approaches have resulted in success. Since there are no error messages, it’s challenging to identify what the issue could be.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class EnemyChaser : MonoBehaviour
{
    private NavMeshAgent meshAgent;
    private GameObject playerObject;
    
    private void Start()
    {
        meshAgent = GetComponent<NavMeshAgent>();
    }
    
    private void update()
    {
        playerObject = GameObject.FindGameObjectWithTag("Player");
        
        if(playerObject != null)
        {
            meshAgent.destination = playerObject.transform.position;
        }
        else
        {
            Debug.Log("Player not found");
        }
    }
}

Does anyone have insights on what might be happening here?

You’ve got a typo in your method name - it’s update() but should be Update(). Unity’s MonoBehaviour methods are case-sensitive, so the lowercase version won’t get called by the engine. That’s why your destination code never runs and your enemy just sits there. Just change private void update() to private void Update() and your NavMeshAgent should start following the player. I’ve done this exact same thing before and wasted hours looking for complex bugs when it was just a capitalization error. Oh, and you might want to cache that player reference in Start() instead of finding it every frame - better for performance. But yeah, the typo’s definitely your main problem.