using System.Collections; using System.Collections.Generic; using UnityEngine; public class FindEnemy : MonoBehaviour { [SerializeField] private List enemies; private void OnTriggerEnter(Collider other) { if(other.gameObject.GetComponent().ownerIndex != gameObject.GetComponentInParent().ownerIndex) { enemies.Add(new PlayerState()); } } }