using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class EnemyPathFinding : MonoBehaviour { [SerializeField] private Transform target; NavMeshAgent agent; private void Start() { agent = GetComponent(); agent.updateRotation = false; agent.updateUpAxis = false; } private void Update() { agent.SetDestination(target.position); } }