Я делаю игру Unity, в которой игрок должен вытолкнуть все объекты «Враг» с самолета.Таким образом, чтобы иметь возможность подсчитать количество упавших объектов, я хочу, чтобы я всегда мог определить, когда произошло столкновение между красным кубом и любым другим кубом.Сценарий, похоже, не обнаруживает столкновения, как это исправить?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Collide : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Enemy")
Destroy(gameObject);
Debug.Log("Hit Occured");
}
}


