using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class movementNavMeshTest : MonoBehaviour { private Vector3 playerPos; public NavMeshAgent playerAgent; // Update is called once per frame void Update() { playerPos = GameObject.FindGameObjectWithTag("Player").transform.position; playerAgent.SetDestination(playerPos); } }