private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.CompareTag("FirstPart"))
{
Destroy(gameObject);
}
}
Для 2D:
private void OnCollisionEnter2D(Collision2D col)
{
if (col.gameObject.CompareTag("FirstPart"))
{
Destroy(gameObject);
}
}