void OnTriggerEnter(Collider col) { // Touched target. if (col.gameObject.CompareTag("agent")) { gameObject.SetActive(false); agent.ReachedTarget(); } }
private void OnCollisionEnter(Collision other) { // Touched target. if (other.gameObject.CompareTag("spiderAgent")) { AddRewardWithScore(-1f); gameObject.SetActive(false); spider.ReachedTarget(); EndEpisode(); } }