📅  最后修改于: 2022-03-11 14:55:27.344000             🧑  作者: Mango
private void OnCollisionEnter2D(Collision2D col)
{
//for "OnCollision" you need "gameObject" listed not just "CompareTag"
if (col.gameObject.CompareTag("weapon"))
{
Destroy(gameObject);
}
}