using System.Collections; using System.Collections.Generic; using UnityEngine; public class AgentTrigger : MonoBehaviour { public GameObject Agent; private void OnTriggerEnter(Collider other) { if(other.tag == "Player") { Agent.GetComponent().Player = other.gameObject; } } }