using StarterAssets; using UnityEngine; using UnityEngine.AI; public class Robot : MonoBehaviour { [SerializeField] AnimationClip idle; FirstPersonController player; NavMeshAgent agent; Animator animator; // Start is called once before the first execution of Update after the MonoBehaviour is created void Awake() { agent = GetComponent(); animator = GetComponent(); } void Start() { player = FindFirstObjectByType(); } // Update is called once per frame void Update() { agent.SetDestination(player.transform.position); } }