using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class PersonMovement : MonoBehaviour { NavMeshAgent agent; private void Awake() { agent = GetComponent(); agent.updateRotation = false; agent.updateUpAxis = false; } public void SetTarget(Transform target) { agent.SetDestination(target.position); } }